...
| Wiki Markup |
|---|
Some systems (such as those with Linux kernel versions greater than or equal to 2.6.23) have an {{O_CLOEXEC}} flag which provides the close-on-exec function directly in {{open()}}. This flag is required by POSIX.1-2008 \[[Austin Group 08|AA. C References#Austin Group 08]\]. In multi-threaded programs this flag should be used if possible as it avoids a timing hole between {{open()}} and {{fcntl()}} when using {{FD_CLOEXEC}}, during which another thread couldcan create a child process while the file descriptor does not have close-on-exec set. |
...