fhandler_base::ioctl (FIONBIO)

Brian Ford ford@vss.fsi.com
Thu Oct 23 23:06:00 GMT 2003


Any reason not to support this?  It seams to me that this patch just
parallels what is already in fhandler_base::fcntl (F_SETFL) for
O_NONBLOCK.

I was trying to fix this issue:

http://www.cygwin.com/ml/cygwin/2003-10/msg01159.html

2003-10-23  Brian Ford  <ford@vss.fsi.com>

	* fhandler.cc (fhandler_base::ioctl): Handle FIONBIO.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444
-------------- next part --------------
Index: fhandler.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler.cc,v
retrieving revision 1.159
diff -u -p -r1.159 fhandler.cc
--- fhandler.cc	30 Sep 2003 21:46:08 -0000	1.159
+++ fhandler.cc	23 Oct 2003 21:38:51 -0000
@@ -909,13 +909,21 @@ fhandler_base::close ()
 int
 fhandler_base::ioctl (unsigned int cmd, void *buf)
 {
+  int res;
+
   if (cmd == FIONBIO)
-    syscall_printf ("ioctl (FIONBIO, %p)", buf);
+    {
+      set_nonblocking (*(int *) buf);
+      res = 0;
+    }
   else
-    syscall_printf ("ioctl (%x, %p)", cmd, buf);
+    {
+      set_errno (EINVAL);
+      res = -1;
+    }
 
-  set_errno (EINVAL);
-  return -1;
+  syscall_printf ("%d = ioctl (%x, %p)", res, cmd, buf);
+  return res;
 }
 
 int


More information about the Cygwin-patches mailing list