File tree Expand file tree Collapse file tree 3 files changed +17
-23
lines changed
Expand file tree Collapse file tree 3 files changed +17
-23
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1919#include <signal.h>
2020#endif
2121
22+ #if defined(HAVE_CLOSERANGE )
23+ #include <linux/close_range.h>
24+ #endif
25+
26+ void
27+ closefrom_excluding (int lowfd , int excludingFd ) {
28+ #if defined(HAVE_CLOSERANGE )
29+ close_range (lowfd , excludingFd - 1 );
30+ closefrom (excludingFd + 1 );
31+ #else
32+ for (int i = lowfd ; i < excludingFd ; i ++ ) {
33+ close (i );
34+ }
35+
36+ closefrom (excludingFd + 1 );
37+ #endif
38+ }
2239
2340// If a process was terminated by a signal, the exit status we return
2441// via the System.Process API is (-signum). This encoding avoids collision with
Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ library
6767 c-sources :
6868 cbits/posix/runProcess.c
6969 cbits/posix/bsd_closefrom.c
70- cbits/posix/close_fds.c
7170 cbits/posix/fork_exec.c
7271 cbits/posix/posix_spawn.c
7372 cbits/posix/find_executable.c
You can’t perform that action at this time.
0 commit comments