[PATCH] Provide posix_spawn implementation

Jeff Johnston jjohnstn@redhat.com
Tue Oct 1 18:10:00 GMT 2013


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.
>
> Petr
>
> On 27 September 2013 21:53, Jeff Johnston <jjohnstn@redhat.com> 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
>>> 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