diff options
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index c4af734c0..86c6b4df6 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1572,3 +1572,17 @@ fhandler_base::fixup_after_fork (HANDLE parent) debug_printf ("inheriting '%s' from parent", get_name ()); fork_fixup (parent, io_handle, "io_handle"); } + +int +fhandler_base::is_nonblocking () +{ + return (openflags & O_NONBLOCK_MASK) != 0; +} + +void +fhandler_base::set_nonblocking (int yes) +{ + int current = openflags & O_NONBLOCK_MASK; + int new_flags = yes ? (!current ? O_NONBLOCK : current) : 0; + openflags = (openflags & ~O_NONBLOCK_MASK) | new_flags; +} |