delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/01/11/08:21:46

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <36895.193.16.155.145.1105449682.squirrel@193.16.155.145>
In-Reply-To: <20050111121830.GA1128@tishler.net>
References: <pan DOT 2005 DOT 01 DOT 05 DOT 09 DOT 19 DOT 22 DOT 647025 AT hochreiter DOT at> <20050105100830 DOT GB5240 AT cygbert DOT vinschen DOT de> <30305 DOT 193 DOT 16 DOT 155 DOT 145 DOT 1104926914 DOT squirrel AT 193 DOT 16 DOT 155 DOT 145> <20050105124336 DOT GA6515 AT cygbert DOT vinschen DOT de> <20050105150204 DOT GA1068 AT tishler DOT net> <pan DOT 2005 DOT 01 DOT 10 DOT 07 DOT 56 DOT 56 DOT 382605 AT hochreiter DOT at> <20050111121830 DOT GA1128 AT tishler DOT net>
Date: Tue, 11 Jan 2005 14:21:22 +0100 (CET)
Subject: Re: popen() fails while system() works
From: "Rainer Hochreiter" <rainer AT hochreiter DOT at>
To: cygwin AT cygwin DOT com
User-Agent: SquirrelMail/1.4.3a-0.f0.9.1.legacy
MIME-Version: 1.0
X-IsSubscribed: yes

> On Mon, Jan 10, 2005 at 08:56:58AM +0100, Rainer Hochreiter wrote:
>> but what's the real reason why popen() results in the address conflict
>> and system() does not?!
>
> AFAICT, popen() calls fork() and system() does not.

this is not true - both functions call vfork()!

cygwin-1.5.12-1/newlib/libc/stdlib/system.c:165 if ((pid = vfork ()) == 0)
cygwin-1.5.12-1/newlib/libc/posix/popen.c:92    switch (pid = vfork()) {

system() calls execve() while popen() calls execl() to start execution of
another file!

-- 
rainer hochreiter             | web:    www.hochreiter.at
lilienfelder str. 43          | e-mail: rainer AT hochreiter DOT at
a-3150 wilhelmsburg / austria | mobile: +43 664 2812175


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019