Skip to content

Commit 8751e35

Browse files
committed
Try hardcoding close_range syscall number for now
1 parent 3619d8c commit 8751e35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cbits/posix/runProcess.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
#include <signal.h>
2323
#endif
2424

25+
#define CLOSE_RANGE_SYSCALL_NUMBER 436
26+
2527
void
2628
closefrom_excluding(int lowfd, int excludingFd) {
2729
// Try using the close_range syscall, provided in Linux kernel >= 5.9.
2830
// We do this directly because not all C libs provide a wrapper (like musl)
29-
long ret = syscall(SYS_close_range, lowfd, excludingFd - 1, 0);
31+
long ret = syscall(CLOSE_RANGE_SYSCALL_NUMBER, lowfd, excludingFd - 1, 0);
3032

3133
if (ret != -1) {
3234
// If that worked, closefrom the remaining range

0 commit comments

Comments
 (0)