diff --git a/src/bun.js/bindings/c-bindings.cpp b/src/bun.js/bindings/c-bindings.cpp index b3db3e7000..cfd507e78f 100644 --- a/src/bun.js/bindings/c-bindings.cpp +++ b/src/bun.js/bindings/c-bindings.cpp @@ -200,15 +200,19 @@ extern "C" void windows_enable_stdio_inheritance() #define CLOSE_RANGE_CLOEXEC (1U << 2) #endif +#ifndef __NR_close_range +// True for architectures we support: +// - arch/arm64/include/asm/unistd32.h +// - include/uapi/asm-generic/unistd.h +// Not true for: +// - DEC Alpha AXP (Alpha architecture) +#define __NR_close_range 436 +#endif + // close_range is glibc > 2.33, which is very new extern "C" ssize_t bun_close_range(unsigned int start, unsigned int end, unsigned int flags) { -// https://github.com/oven-sh/bun/issues/9669 -#ifdef __NR_close_range return syscall(__NR_close_range, start, end, flags); -#else - return ENOSYS; -#endif } static void unset_cloexec(int fd)