[Bug libc/10353] Methods for deleting all file descriptors greater than given integer

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug libc/10353] Methods for deleting all file descriptors greater than given integer

claude at 2xlibre dot net
https://sourceware.org/bugzilla/show_bug.cgi?id=10353

--- Comment #13 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Adhemerval Zanella from comment #8)

> In fact, IMHO a closefrom syscall won't help much for posix_spawn. Current
> implementation for Linux uses a clone(CLONE_VM, CLONE_VFORK) which means
> that only the calling thread will be suspended while the helper thread
> issues execlpe or _exit.  It means that a file action to issue a closefrom
> will also be susceptible to race conditions in multi-thread environments.

In fact, this is not true since we do not use CLONE_FILES for posix_spawn. So
it is possible to implement posix_spawn_file_actions_addclosefrom_np, albeit it
would require interacting over the open file descriptors (and thus might incur
in performance issues).

--
You are receiving this mail because:
You are on the CC list for the bug.