Re: F_DUPFD_CLOEXEC implementation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Denys Vlasenko
Date: Tuesday, October 2, 2007 - 2:28 am

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
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
F_DUPFD_CLOEXEC implementation, Ulrich Drepper, (Fri Sep 28, 10:34 am)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Fri Sep 28, 11:19 am)
Re: F_DUPFD_CLOEXEC implementation, Ulrich Drepper, (Fri Sep 28, 11:23 am)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Sat Sep 29, 5:31 pm)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Sun Sep 30, 4:11 pm)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Sun Sep 30, 4:58 pm)
Re: F_DUPFD_CLOEXEC implementation, Miquel van Smoorenburg, (Sun Sep 30, 5:59 pm)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Sun Sep 30, 8:15 pm)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Mon Oct 1, 3:07 am)
Re: F_DUPFD_CLOEXEC implementation, Al Viro, (Mon Oct 1, 11:16 am)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Mon Oct 1, 11:49 am)
Re: F_DUPFD_CLOEXEC implementation, Michael Tokarev, (Mon Oct 1, 11:53 am)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Mon Oct 1, 12:04 pm)
Re: F_DUPFD_CLOEXEC implementation, Denys Vlasenko, (Tue Oct 2, 2:28 am)
Re: F_DUPFD_CLOEXEC implementation, Davide Libenzi, (Tue Oct 2, 12:52 pm)