about summary refs log tree commit diff
path: root/support/support-open-dev-null-range.c
Commit message (Collapse)AuthorAgeFilesLines
* support: Also return fd when it is 0Siddhesh Poyarekar2021-10-061-7/+7
| | | | | | | | The fd validity check in open_dev_null checks if fd > 0, which would lead to a leaked fd if it is == 0. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* support: Add support_open_dev_null_rangeAdhemerval Zanella2021-08-261-0/+134
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.