Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-10-25 16:32:56 +0400
committerCorinna Vinschen <corinna@vinschen.de>2003-10-25 16:32:56 +0400
commit89256ff149e706733fb0e6076b137f0005d0e41c (patch)
tree782d4cc260adfaa8d8d3eb2c783e3f1d7be50c13 /winsup/cygwin/fhandler.cc
parent28194e813eecd55cbc126f0ffd2a3d28d7b526cb (diff)
* fhandler.cc (fhandler_base::ioctl): Handle FIONBIO.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 79f3e2621..834ea5fe0 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -909,13 +909,22 @@ fhandler_base::close ()
int
fhandler_base::ioctl (unsigned int cmd, void *buf)
{
- if (cmd == FIONBIO)
- syscall_printf ("ioctl (FIONBIO, %p)", buf);
- else
- syscall_printf ("ioctl (%x, %p)", cmd, buf);
+ int res;
- set_errno (EINVAL);
- return -1;
+ switch (cmd)
+ {
+ case FIONBIO:
+ set_nonblocking (*(int *) buf);
+ res = 0;
+ break;
+ default:
+ set_errno (EINVAL);
+ res = -1;
+ break;
+ }
+
+ syscall_printf ("%d = ioctl (%x, %p)", res, cmd, buf);
+ return res;
}
int