[PATCH] Provide posix_spawn implementation

Jeff Johnston jjohnstn@redhat.com
Fri Sep 27 20:53:00 GMT 2013


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

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
    Makefile.am)

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.



More information about the Newlib mailing list