[PATCH] posix: Fix open file action for posix_spawn on Linux

Florian Weimer fw@deneb.enyo.de
Fri Sep 16 22:58:00 GMT 2016


* Adhemerval Zanella:

> On posix_spawn open file action (issued by posix_spawn_file_actions_addopen)
> POSIX states that if fildes was already an open file descriptor, it shall be
> closed before the new file is openedi [1].  This avoid pontential issues when
> posix_spawn plus addopen action is called with the process already at maximum
> number of file descriptor opened and also for multiple actions on single-open
> special paths (like /dev/watchdog).
>
> This fixes its behavior on Linux posix_spawn implementation and also adds
> a tests to check for its behavior.

The patch appears to be incomplete:

../sysdeps/unix/sysv/linux/spawni.c: In function ‘__spawni_child’:
../sysdeps/unix/sysv/linux/spawni.c:244:3: error: implicit declaration of function ‘fd_is_valid’ [-Werror=implicit-function-declaration]



More information about the Libc-alpha mailing list