fd-util: split out fallback logic for close_all_fds()

No functional change. Just refactoring.

With this change, we can test each logic directly without seccomp
or hiding procfs.
This commit is contained in:
Yu Watanabe
2025-09-10 19:20:50 +09:00
parent e52a1acb81
commit 93d037dbd0
3 changed files with 96 additions and 153 deletions
+2
View File
@@ -112,6 +112,8 @@ int get_max_fd(void);
int close_all_fds(const int except[], size_t n_except);
int close_all_fds_without_malloc(const int except[], size_t n_except);
int close_all_fds_by_proc(const int except[], size_t n_except);
int close_all_fds_frugal(const int except[], size_t n_except);
int pack_fds(int fds[], size_t n);