diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-10-25 16:32:56 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-10-25 16:32:56 +0400 |
commit | 89256ff149e706733fb0e6076b137f0005d0e41c (patch) | |
tree | 782d4cc260adfaa8d8d3eb2c783e3f1d7be50c13 /winsup/cygwin/fhandler.cc | |
parent | 28194e813eecd55cbc126f0ffd2a3d28d7b526cb (diff) |
* fhandler.cc (fhandler_base::ioctl): Handle FIONBIO.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 21 |
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 |