comp.lang.ada
 help / color / mirror / Atom feed
From: kst@thomsoft.com (Keith Thompson)
Subject: Re: Ada Equivalent of "system()" in C?
Date: 1996/04/17
Date: 1996-04-17T00:00:00+00:00	[thread overview]
Message-ID: <Dq08CC.EqG@thomsoft.com> (raw)
In-Reply-To: emery-1604961854590001@line029.nwm.mindlink.net

In <emery-1604961854590001@line029.nwm.mindlink.net> emery@grebyn.com (David Emery) writes:
[...]
> Note that the return value is NOT the return value of the command, but
> rather of the fork() that is used to set up execution of the command.

That's not quite correct.  The system function returns -1 (and sets
errno) if the fork or exec fails.  Otherwise it returns the exit status
of the shell (sh) that it invokes to execute the command; the format of
this exit status is a bit tricky.  This information is from a SunOS 5.4
(Solaris 2.4) man page; see your local man page for details.

The above is Unix-specific.  The ISO C standard has very little to say
about the return value of system, or even its semantics.

-- 
Keith Thompson (The_Other_Keith) kst@thomsoft.com <*>
TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products
10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718
This sig uses the word "Exon" in violation of the Communications Decency Act.




  reply	other threads:[~1996-04-17  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-15  0:00 Ada Equivalent of "system()" in C? Dave Sparks
1996-04-16  0:00 ` Samuel Tardieu
1996-04-16  0:00 ` Robert Dewar
1996-04-17  0:00   ` Bob Kitzberger
1996-04-16  0:00     ` David Emery
1996-04-17  0:00       ` Keith Thompson [this message]
1996-04-17  0:00       ` Robert Dewar
1996-04-22  0:00         ` Sandy Wise
1996-04-19  0:00       ` Ron J Theriault
1996-04-17  0:00   ` Samuel Tardieu
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox