[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::axp-developer

Title:Alpha Developer Support
Notice:[email protected], 800-332-4786
Moderator:HYDRA::SYSTEM
Created:Mon Jun 06 1994
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3722
Total number of notes:11359

3657.0. "The Jet Propulsion Laboratory" by HYDRA::TALATINIAN () Fri May 23 1997 08:42

    Company Name :  The Jet Propulsion Laboratory
    Contact Name :  Al Wong
    Phone        :  (818) 795-4928, x234
    Fax          :  
    Email        :  [email protected]
    Date/Time in :  23-MAY-1997 07:42:02
    Entered by   :  John Talatinian
    SPE center   :  MRO

    Category     :  UNIX
    OS Version   :  
    System H/W   :  ALPHA


    Brief Description of Problem:
    -----------------------------

Hello,

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.

I would appreciate a timely answer. Thank you.

-----------------------------------------------------------
Al Wong, [email protected]
The Jet Propulsion Laboratory
Pasadena, California
(818) 795-4928, x234
-----------------------------------------------------------

T.RTitleUserPersonal
Name
DateLines
3657.1HYDRA::MGREENFIELDFri May 23 1997 15:2152
other related notes

mike

From:	HYDRA::MGREENFIELD  23-MAY-1997 14:16:25.82
To:	crl::"[email protected]",me
CC:	
Subj:	response


	Al;

	By way of introduction, I am Mike Greenfield and am working on your
 Digital Unix issue.  I went down the same path as you (looked at wait.h and 
 even the dunix sources), but did not see any obvious list of status return 
 codes.  I have escalated this request to DUNIX Engineering for help - just
 wanted to ack that we got the note and are working on it.

	Can you send me what version of dunix you are using, what your 
 compiler/link switches are and if possible, the shell script you are calling?


	Thanks

	Mike
	SPE Alpha Support


From:	HYDRA::MGREENFIELD  23-MAY-1997 14:09:53.55
To:	smurf::booth,me
CC:	
Subj:	isv help request


	Sarah;

	I am having trouble answering the attached isv's question and would
 be grateful if your team could provide some guidance.

	Is there a reference that provides all of the exit status codes 
 for system().  Looking at sys/wait.h was not illuminating.  If further 
 information is needed from the ISV, please let me know what should be 
 requested.  

	Thanks

	regards,

	Mike



3657.2HYDRA::MGREENFIELDFri May 23 1997 17:3331
spoke with al and got additional details

1) his email signature file is wrong.  Correct address is
   [email protected]

2) situation is a bit more complex than his note let on:

   his simple c program is a cgi that is run in the context of the netscape 
   server.

   he has defined environment variable for home, shell and path

   he has defined a .netrc to automate the process

   his script is as simple as !/bin csh
			      ftp -i machine-name

   his script works when not run as a cgi script

   he gets a 256 every time he runs this as the cgi
   (so it does not appear that this is the child process pid as
   suggested in the man 2 wait pages.  man system suggests that the
   call does not return until the shell script completes and the   
   child exits.


 Al agreed to send me his code and netrc fragments


   Mike