ContainerizationOS: Speed up fd closes (#222)

Instead of looping through from minimum fd -> rlimit max, we can
close_range(2) or read /proc/self/fd on Linux, and read /dev/fd on
macOS.
This commit is contained in:
Danny Canter
2025-07-22 10:30:10 -04:00
committed by GitHub
parent 8b93a2083a
commit fcd198e968
2 changed files with 65 additions and 8 deletions
+3
View File
@@ -17,6 +17,8 @@
#ifndef exec_command_h
#define exec_command_h
#if defined(__linux__) || defined(__APPLE__)
#include <sys/types.h>
#include <unistd.h>
@@ -46,4 +48,5 @@ int exec_command(pid_t *result, const char *executable, char *const argv[],
const int file_handle_count, const char *working_directory,
struct exec_command_attrs *attrs);
#endif /* defined(__linux__) || defined(__APPLE__) */
#endif /* exec_command_h */