This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] posix: Fix open file action for posix_spawn on Linux
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 17 Sep 2016 00:58:09 +0200
- Subject: Re: [PATCH] posix: Fix open file action for posix_spawn on Linux
- Authentication-results: sourceware.org; auth=none
- References: <1474060583-1277-1-git-send-email-adhemerval.zanella@linaro.org>
* 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]