Lines Matching refs:except
207 static int close_all_fds_frugal(const int except[], size_t n_except) { in close_all_fds_frugal() argument
210 assert(n_except == 0 || except); in close_all_fds_frugal()
231 if (fd_in_set(fd, except, n_except)) in close_all_fds_frugal()
244 static int close_all_fds_special_case(const int except[], size_t n_except) { in close_all_fds_special_case() argument
245 assert(n_except == 0 || except); in close_all_fds_special_case()
273 if ((except[0] <= 3 || close_range(3, except[0]-1, 0) >= 0) && in close_all_fds_special_case()
274 (except[0] >= INT_MAX || close_range(MAX(3, except[0]+1), -1, 0) >= 0)) in close_all_fds_special_case()
289 int close_all_fds_without_malloc(const int except[], size_t n_except) { in close_all_fds_without_malloc() argument
292 assert(n_except == 0 || except); in close_all_fds_without_malloc()
294 r = close_all_fds_special_case(except, n_except); in close_all_fds_without_malloc()
300 return close_all_fds_frugal(except, n_except); in close_all_fds_without_malloc()
303 int close_all_fds(const int except[], size_t n_except) { in close_all_fds() argument
307 assert(n_except == 0 || except); in close_all_fds()
309 r = close_all_fds_special_case(except, n_except); in close_all_fds()
335 memcpy(sorted, except, n_except * sizeof(int)); in close_all_fds()
385 … return close_all_fds_frugal(except, n_except); /* ultimate fallback if /proc/ is not available */ in close_all_fds()
403 if (fd_in_set(fd, except, n_except)) in close_all_fds()