Constant lrs::file::flags::FILE_CLOSE_ON_EXEC

Close the file when exec is called.

Syntax

const FILE_CLOSE_ON_EXEC: FileFlags = FileFlags(O_CLOEXEC);

Remarks

It's not possible to not use this flag when opening a file as lrs will always add this flag before performing an open syscall. If you want to prevent a file from being closed after an exec call use set_close_on_exec.

The rationale is that setting the close-on-exec flag is a racy operation while unsetting it is not.

See also