1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 05:01:48 +02:00

Merge pull request #11278 from Mic92/close-fds

libutil: rename and optimize closeMostFDs
This commit is contained in:
Robert Hensing 2024-08-26 15:51:34 +02:00 committed by GitHub
commit 8bd835b7bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 8 deletions

View file

@ -154,10 +154,10 @@ public:
namespace unix {
/**
* Close all file descriptors except those listed in the given set.
* Close all file descriptors except stdio fds (ie 0, 1, 2).
* Good practice in child processes.
*/
void closeMostFDs(const std::set<Descriptor> & exceptions);
void closeExtraFDs();
/**
* Set the close-on-exec flag for the given file descriptor.