This is the mail archive of the
newlib@sourceware.org
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: Fri, 27 Sep 2013 16:53:38 -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>
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.