* fhandler.cc (fhandler_base::is_nonblocking): New method.

(fhandler_base::set_nonblocking): Ditto.
        * fhandler.h (fhandler_base): Declare new methods `is_nonblocking' and
        `set_nonblocking'.
        * fhandler_socket.cc (fhandler_socket::ioctl): Use `set_nonblocking'.
        * fhandler_tty.cc (fhandler_pty_master::process_slave_output):
        Use `is_nonblocking'.
        (fhandler_tty_slave::read): Ditto.
        (fhandler_tty_slave::ioctl): Use `set_nonblocking'.
        (fhandler_pty_master::ioctl): Ditto.
        * net.cc (cygwin_sendto): Fallback to winsock 1 functionality
        in case of nonblocking IO.
        (cygwin_recvfrom): Ditto.
        (cygwin_recv): Ditto.
        (cygwin_send): Ditto.
        * syscalls.cc (_read): Use `is_nonblocking'.
This commit is contained in:
Corinna Vinschen
2001-08-15 07:49:15 +00:00
parent da3ea61edd
commit 5fd12fb0cc
7 changed files with 46 additions and 24 deletions

View File

@@ -271,7 +271,7 @@ _read (int fd, void *ptr, size_t len)
// set_sig_errno (0);
fh = cygheap->fdtab[fd];
DWORD wait = (fh->get_flags () & O_NONBLOCK_MASK) ? 0 : INFINITE;
DWORD wait = fh->is_nonblocking () ? 0 : INFINITE;
/* Could block, so let user know we at least got here. */
syscall_printf ("read (%d, %p, %d) %sblocking, sigcatchers %d", fd, ptr, len, wait ? "" : "non", sigcatchers);