aboutsummaryrefslogtreecommitdiff
path: root/support/support.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-08-24 16:12:24 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-08-26 17:13:45 -0300
commite814f4b04ee413a7bb3dfa43e74c8fb4abf58359 (patch)
treed83648696fae2c7a8ee71da52297bed7dafe06c6 /support/support.h
parent5aa359d33163bde660fec9b26e23cfb93d63ecde (diff)
downloadglibc-e814f4b04ee413a7bb3dfa43e74c8fb4abf58359.zip
glibc-e814f4b04ee413a7bb3dfa43e74c8fb4abf58359.tar.gz
glibc-e814f4b04ee413a7bb3dfa43e74c8fb4abf58359.tar.bz2
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.
Diffstat (limited to 'support/support.h')
-rw-r--r--support/support.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/support/support.h b/support/support.h
index 834dba9..e6911e1 100644
--- a/support/support.h
+++ b/support/support.h
@@ -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 */