Close the file when exec is called.
const FILE_CLOSE_ON_EXEC: FileFlags = FileFlags(O_CLOEXEC);
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.
open(2) and O_CLOEXEC therein