Contents

closeOnExec

Indicates that executing a program closes the file.

Declaration

static var closeOnExec: FileDescriptor.OpenOptions { get }

Mentioned in

Discussion

Normally, file descriptors remain open across calls to the exec(2) family of functions. If you specify this option, the file descriptor is closed when replacing this process with another process.

The state of the file descriptor flags can be inspected using F_GETFD, as described in the fcntl(2) man page.

The corresponding C constant is O_CLOEXEC.

See Also

Specifying Options