On Monday 01 October 2007 20:04, Davide Libenzi wrote:
I'm confused. I am saying exactly this same thing: that I cannot
do it atomically using standard unix operations, but I still need
to do a nonblocking read. Why are you explaining to me that it
cannot be done? I *know*. I'm asking what API should be
added/extended to make it possible.
I have following proposals:
* make recv(..., MSG_DONTWAIT) work on any fd
Sounds neat, but not trivial to implement in current kernel.
* new fcntl command F_DUPFL: fcntl(fd, F_DUPFL, n):
Analogous to F_DUPFD, but gives you *unshared* copy of the fd.
Further seeks, fcntl(fd, F_SETFL, O_NONBLOCK), etc won't affect
any other process.
How hard would it be implement F_DUPFL in current kernel?
--
vda
-