1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

support: Add support_open_dev_null_range

It returns a range of file descriptor referring to the '/dev/null'
pathname.  The function takes care of restarting the open range
if a file descriptor is found within the specified range and
also increases RLIMIT_NOFILE if required.

Checked on x86_64-linux-gnu.
This commit is contained in:
Adhemerval Zanella
2021-08-24 16:12:24 -03:00
parent 5aa359d331
commit e814f4b04e
4 changed files with 299 additions and 0 deletions

View File

@@ -193,6 +193,14 @@ struct support_stack support_stack_alloc (size_t size);
/* Deallocate the STACK. */
void support_stack_free (struct support_stack *stack);
/* Create a range of NUM opened '/dev/null' file descriptors using FLAGS and
MODE. The function takes care of restarting the open range if a file
descriptor is found within the specified range and also increases
RLIMIT_NOFILE if required.
The returned value is the lowest file descriptor number. */
int support_open_dev_null_range (int num, int flags, mode_t mode);
__END_DECLS
#endif /* SUPPORT_H */