tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: supporting O_CLOEXEC and O_NONBLOCK in all file descriptor creating syscalls



On Fri, Jun 24, 2011 at 04:01:52PM -0400, Christos Zoulas wrote:
> To avoid the race between file descriptor creation and CLOEXEC linux did:
> 
>     http://udrepper.livejournal.com/20407.html
> 
> I have already implemented the open portion and the guts of pipe2() and dup3()
> for COMPAT_LINUX, and it is not a lot of work to finish the rest. Should I
> finish it?

Personally, I consider most of this bloat. It's nice to have for
socket() and open() to avoid system calls in the hot path of server, but
generally most applications are served better by calling closefrom(3)
after fork. That solves the race condition and also avoids leaking file
descriptors the parent of the original process passed down for one
reason or the other.

Joerg


Home | Main Index | Thread Index | Old Index