Skip to content

Commit f08162d

Browse files
committed
Try hardcoding close_range syscall number for now
1 parent 9ca73a1 commit f08162d

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
@@ -24,11 +24,13 @@
2424
#include <signal.h>
2525
#endif
2626

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

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

0 commit comments

Comments
 (0)