diff options
Diffstat (limited to 'executor/common_linux.h')
| -rw-r--r-- | executor/common_linux.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index 6b1826c65..f7f64a5c6 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -4818,6 +4818,7 @@ static void setup_test() #endif #if SYZ_EXECUTOR || SYZ_CLOSE_FDS +#include <sys/syscall.h> #define SYZ_HAVE_CLOSE_FDS 1 static void close_fds() { @@ -4825,6 +4826,10 @@ static void close_fds() if (!flag_close_fds) return; #endif +#ifdef SYS_close_range + if (!syscall(SYS_close_range, 3, MAX_FDS, 0)) + return; +#endif // Keeping a 9p transport pipe open will hang the proccess dead, // so close all opened file descriptors. // Also close all USB emulation descriptors to trigger exit from USB |
