Subject: Re: possible bug in NetBSD asynchronous I/O
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 04/30/2001 02:27:56
>> I see what is going on now.  NetBSD is the only of the OS's you
>> mentioned that uses socketpair for pipes.

> Where do we use socketpair()?  sys_pipe() calls socreate() to create
> two UNIX domain sockets, and then it connects them.

We don't actually use socketpair, in the sense of calling it in a
user-mode stub, or even calling sys_socketpair() in the kernel.

However, the results are basically the same: comparing sys_pipe() to
sys_socketpair() makes it clear that the only difference between
pipe(x) and socketpair(AF_LOCAL,SOCK_STREAM,0,x) - once the call has
returned - is that the former is unidirectional.  (Not because it's
shut down half of each socket, but because it uses FREAD for one end
and FWRITE for the other, instead of socketpair()'s FREAD|FWRITE for
each.)

(Speaking of kernel file descriptor diddling, is it my imagination, or
does an FIOASYNC ioctl error during an F_SETFL fcntl cause non-blocking
mode to be turned off even if it shouldn't be, ie, if it was on before
the call and was not being turned off by the call?)

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B