This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC/PATCH glibc 0/2] setting working dir in posix_spawn()
- From: Jonathan Nieder <jrnieder at gmail dot com>
- To: Eric Blake <eblake at redhat dot com>
- Cc: austin-group-futures-l at opengroup dot org, libc-alpha at sourceware dot org
- Date: Fri, 27 Aug 2010 01:35:46 -0500
- Subject: [RFC/PATCH glibc 0/2] setting working dir in posix_spawn()
- References: <alpine.LFD.2.00.1008241029530.1046@i5.linux-foundation.org><20100825013625.GC10423@burratino><4C74BFA7.1090907@viscovery.net><4C752739.3010808@redhat.com><20100826061815.GH9708@burratino><4C767682.7030700@redhat.com>
(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