This is the mail archive of the
mailing list for the newlib project.
Re: [PATCH] Provide posix_spawn implementation
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: newlib at sourceware dot org
- Cc: Petr Hosek <phosek at chromium dot org>
- Date: Tue, 01 Oct 2013 14:10:34 -0400
- Subject: Re: [PATCH] Provide posix_spawn implementation
- Authentication-results: sourceware.org; auth=none
- References: <CABOUYF5rq6b1ix2Q4wEUXqM7DhE+DbjS_VLF0iDRA8tsae-SDg at mail dot gmail dot com> <5245F052 dot 7040900 at redhat dot com> <CADGjWW1c1KOxcQS=QnU_qPowjJhanN3OwsG8PjU7tFxqDfJzMw at mail dot gmail dot com>
Looks good. In the future, please provide a ChangeLog entry in the note
that announces the patch. I have create the entry and checked in the code.
-- Jeff J.
On 10/01/2013 11:07 AM, Petr Hosek wrote:
Thanks a lot for the comments! Attached is the updated patch; let me
know if you spot any other issues.
On 27 September 2013 21:53, Jeff Johnston <firstname.lastname@example.org> wrote:
On 09/16/2013 04:07 PM, Petr Hosek wrote:
I have ported over posix_spawn implementation from FreeBSD to newlib.
It implements posix_spawn interface in terms of existing POSIX
interfaces, in particular vfork and exec.
This should make it easier to port existing code which uses
posix_spawn, which is already supported by glibc as well as all BSD
variants. In the longer term, posix_spawn could be also interesting to
Cygwin as the interface is more akin to CreateProcess provided by
Windows so the applications using posix_spawn instead of fork/vfork
would get performance improvement compared to the current fork
1. posix_spawn should be listed as an EL/IX 4 source since it is not
specified in the EL/IX standard (as opposed to a general source in
2. some of the posix routines are protected by #ifndef _NO_xxxxx
This is needed for this code (#ifndef _NO_POSIX_SPAWN)
3. execvpe is a gnu extension starting in glibc
2.11. It appears to be only supported by
Cygwin in newlib. I can't speak for RTEMS and powerpcle which are
users of the posix dir, but you will have to set _NO_POSIX_SPAWN for
x86-linux which don't supply this unless you can replace
the code or shield it with a Cygwin check. The changes go in
configure.host. You should turn it off for RTEMS and powerpcle
until they confirm one way or another.
4. Other posix code there such as popen and opendir adds a check for
HAVE_FCNTL before using it.
5. Please add documentation similar to what is found in popen.c
-- Jeff J.