Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <426DC858.27564CF8@dessent.net>
Date: Mon, 25 Apr 2005 21:49:28 -0700
From: Brian Dessent <brian@dessent.net>
Organization: My own little world...
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: system() fails on pristine Windows systems
References: <426D5CAB.2070804@awcubed.com> <d4jrnk$hkk$1@sea.gmane.org> <426DB60B.9090004@awcubed.com> <426DBB5D.5660669D@dessent.net> <426DBDEE.5080905@awcubed.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com

Archie Warnock wrote:

> > You could fork() and exec(), or just call one of the spawn() family of
> > functions.  This is all open source you know, you could look and see how
> > system() is implemented in winsup/cygwin/syscalls.cc.
> 
> I'll have to look and see there.  The fork()/exec()/spawn() functions
> don't quite do what I need, though.

system() is just a wrapper around spawnvp().  If spawn() isn't what you
want then neither is system().  spawn() does not necessarily replace the
current process (_P_OVERLAY), it can also start and optionally wait for
a subprocess (_P_WAIT, _P_NOWAIT, _P_DETACH).

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

