setCloExec

Helper function to set the close-on-exec bit in a bit mask which specifies option flags for a system call that obtains a new file descriptor, such as open(2). On recent Linux all such system/library functions support enabling the close-on-exec option; this is a Linux extension to POSIX. Some of these flag accepting functions were added more recently with a name extension, for example accept4(2) or inotify_init1(2).

T
setCloExec
(
T
U
)

Parameters

flags T

the flags where the close-on-exec bit should be set if open_with_close_on_exec is true

close_on_exec_flag U

a bitmask with only the close-on-exec bit set

Return Value

Type: T

flags | close_on_exec_flag if open_with_close_on_exec is true, otherwise flags.

Meta