Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Return Status Codes for system() Function???
@ 1997-05-23  4:00 James Bond
  1997-05-24  4:00 ` John Hascall
  1997-05-24  4:00 ` Gerald A. Feldman
  0 siblings, 2 replies; 3+ messages in thread
From: James Bond @ 1997-05-23  4:00 UTC (permalink / 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
-----------------------------------------------------------



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-05-24  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-23  4:00 Return Status Codes for system() Function??? James Bond
1997-05-24  4:00 ` John Hascall
1997-05-24  4:00 ` Gerald A. Feldman

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