It sets the close-on-exec flag for the file descriptor, which causes the file descriptor to automatically (and atomically) close when any of the exec
family functions succeeds.
It also checks the return value to see if the operation was unsuccessful, which is useless if the file descriptor is valid, since there is no condition under which this operation should fail with a valid file descriptor.
R .. May 25, '11 at 13:21 2011-05-25 13:21
source share