[109] in Pthreads mailing list archive
Re: Patches for pthreads-1.60 beta3
daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Sep 6 00:47:43 1995
To: NIIBE Yutaka <gniibe@mri.co.jp>
Cc: Greg Hudson <ghudson@MIT.EDU>, pthreads@MIT.EDU
In-Reply-To: Your message of "Wed, 06 Sep 1995 13:24:04 +0900."
<199509060424.NAA00828@megatherium.mri.co.jp>
Date: Wed, 06 Sep 1995 00:27:59 EDT
From: Greg Hudson <ghudson@MIT.EDU>
> The users might request non-blocking I/O, this is redundant.
This is not redundant. If I (a user program) call read() on a socket
I have set non-blocking with fcntl(), and there is no data waiting, I
should get -1 with errno set to EWOULDBLOCK. If I have not set the
socket non-blocking (and it didn't have the non-blocking bit set when
the process started), my thread should block.
fd_table[fd]->flags should contain the file descriptor's flags with
the non-blocking bits set according to whether the user has requested
non-blocking behavior. The actual flags on the kernel file descriptor
should contain fd_table[fd]->flags | __FD_NONBLOCK.