[RFC/PATCH glibc 0/2] setting working dir in posix_spawn()
Jonathan Nieder
jrnieder@gmail.com
Fri Aug 27 14:11:00 GMT 2010
(pruned cc's, +cc:libc-alpha)
Eric Blake wrote:
> On 08/26/2010 12:18 AM, Jonathan Nieder wrote:
>> Do you think there would be any interest in a posix_spawn() variant
>> that takes a dir parameter? I am imagining something like this:
>
> Of your variants, I would most prefer:
>
>> int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t
>> *file_actions, int dirfd);
Okay, here's a proof of concept (for the easy case --- a fork()-
based implementation for Linux). Patches apply to 8b2b771^.
> For that matter, it may also be worth adding
> posix_spawn_file_actions_addopenat, which mirrors the recent
> addition of openat() semantics.
Sounds like a good idea. I did not try it because I did not want to
think about whether it would cause the __spawn_action struct to grow
(and if so, what ramifications that would have, if any).
Thoughts?
Jonathan Nieder (2):
Fix typo in posix_spawn_file_actions_addclose() implementation
Implement fchdir action for posix_spawn()
NEWS | 4 +++-
posix/Makefile | 2 +-
posix/Versions | 3 +++
posix/spawn.h | 8 ++++++++
...faction_addclose.c => spawn_faction_addchdir.c} | 10 +++++-----
posix/spawn_faction_addclose.c | 2 +-
posix/spawn_int.h | 7 ++++++-
sysdeps/posix/spawni.c | 6 ++++++
8 files changed, 33 insertions(+), 9 deletions(-)
copy posix/{spawn_faction_addclose.c => spawn_faction_addchdir.c} (86%)
--
1.7.2.2
More information about the Libc-alpha
mailing list