This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: popen() fails while system() works


> 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@hochreiter.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]