Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: James Bond <awong@klab.caltech.edu>
Subject: Return Status Codes for system() Function???
Date: 1997/05/23	[thread overview]
Message-ID: <3385E815.41C6@klab.caltech.edu> (raw)


Hello,

I'm stumped and hope this newsgroup can help me.

I'm getting an error code from the system() function (C language)
which doesn't appear to be documented anywhere.  I am invoking
system() which runs a shell script which in turn runs FTP.
However the FTP invocation is failing although system() exits
normally.

The return status from system() is 256!?  What does this code mean?
Note errno is NOT set. errno is still zero.  256 is the int value
that is returned by system().

According to the man page, system() will return 0 if successful.
On error system() will return -1 and errno is set. Any other value
(such as 256!) is the same as wait().  Looking at the wait() man page,
it tells you to see the wait.h file.  Looking at the wait.h file,
there is no mention of the 256 return status!  What gives?

Looking at the other header files, there is no clue about the
return values of system().  Tried looking at the DEC website and
could not find a list of values. Actually, a list of the possible
values system() returns and their meanings would be very helpful.

I'm working on a DEC Alpha with OSF/1 and the cc compiler that
came with the machine.

Please cc: your reply to my email address below as I don't
read this newsgroup very often. Thank you.

-----------------------------------------------------------
Al Wong, wong@southport.jpl.nasa.gov
The Jet Propulsion Laboratory
Pasadena, California
(818) 795-4928, x234
-----------------------------------------------------------



             reply	other threads:[~1997-05-23  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-23  4:00 James Bond [this message]
1997-05-24  4:00 ` Return Status Codes for system() Function??? John Hascall
1997-05-24  4:00 ` Gerald A. Feldman
read-only archive

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