Hi,
I'm trying to open a file passing certain flags to control some aspects of how the file descriptor is managed, and in particular I wanted to pass the FD_CLOEXEC
flag to ensure that the file descriptor will be closed when we execute exec
or fork
(although even having those flags, I'll take care of closing these file descriptors "manually" as soon as possible).
The problem is that std::fs::File::open
does not allow to pass any flags, and when using std::fs::OpenOptions
I don't have much more control than in the previous case, just being able to pass the "typical" flags controlling whether we can read or write.
Is there any way to use more advanced POSIX features when dealing with file descriptors?
Thank you for your insights.