[Bug libc/10353] Methods for deleting all file descriptors greater than given integer (closefrom)
adhemerval.zanella at linaro dot org
sourceware-bugzilla@sourceware.org
Wed Dec 16 17:07:25 GMT 2020
https://sourceware.org/bugzilla/show_bug.cgi?id=10353
Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at sourceware dot org |adhemerval.zanella at linaro dot o
| |rg
--- Comment #23 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Cristian Rodríguez from comment #21)
> The linux kernel now has a close_range system call for this purpose. It
> would be cool if glibc can provide both a syscall wrapper for close_range
> *AND* closefrom implemented on top close_range in the linux target.
The close_range seems a sensible addition to added as a syscall wrapper for
Linux, without any extra fallback, and returning ENOSYS on older kernel (as for
copy_file_range). From Florian message, he should be ok with a fallback to
/proc/self/fd if the syscall is not available; but this will make function not
fail-safe and add possible issues (as it was usual for multiple syscall
fallbacks we added previosuly).
I also agree that closefrom shouldbe added as a GNU extension, multiple system
have added it.
For posix_spawn extension, I think we can add a /proc/self/fd fallback that
sets FD_CLOEXEC for each; the spawn will fail if it can not be executed and it
is allowed by the interface.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list