nmh-workers
[Top] [All Lists]

Re: [nmh-workers] closefds() _before_ fork?

2019-04-23 11:05:15
Hi Ken,

I realize that dup2() clears the FD_CLOEXEC flag on the new file
descriptor so the "normal" case of an opened file being dup2() down to
0 would work correctly, but the wrinkle is that it does NOT if the old
and new file descriptor are the same.  That is admittedly unlikely,
but it could happen in a few cases so I'd like to be as robust as
possible.

Are you aware of dup3(2)?

-- 
Cheers, Ralph.

-- 
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>