This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Provide posix_spawn implementation

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 <> 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

Some comments.

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  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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]