Mic92
released this
26 Aug 08:56
libutil: rename and optimize closeMostFDs
this is only used to close non-stdio files in derivation sandboxes. we
may as well encode that in its name, drop the unnecessary integer set,
and use close_range to deal with the actual closing of files. not only
is this clearer, it also makes sandbox setup on linux fast by 1ms each
(cherry-picked and adapted from
https://git.lix.systems/lix-project/lix/commit/c7d97802e4f59b8621e67cf62275d6a7fde8fe62)
Co-authored-by: Eelco Dolstra <[email protected]>
Co-authored-by: Cole Helbling <[email protected]>
Co-authored-by: John Ericson <[email protected]>