tech-kern archive

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

Re: Per-descriptor state



On Thu, May 04, 2023 at 08:40:49AM -0400, Mouse wrote:
 > >> I can't think of any at all; to begin with it's limited to forks
 > >> that don't exec
 > [...]
 > 
 > Well, except for libraries that open fds internally, without exposing
 > them to the calling code.  Depending on the user case, they may want
 > them closed if the application forks.
 >
 > [...]
 > 
 > Because one wants to exec a child process, maybe?

If the fork is going to exec, O_CLOEXEC is sufficient; I can't think
of any realistic situation where having a second reference to the same
file for at most few extra milliseconds can actually hurt anything.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index