home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / aix / 11873 < prev    next >
Encoding:
Internet Message Format  |  1992-11-24  |  1.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!rutgers!concert!samba!usenet
  2. From: Eli.Mantel@launchpad.unc.edu (Eli Mantel)
  3. Newsgroups: comp.unix.aix
  4. Subject: return code 9 from system()
  5. Message-ID: <1992Nov24.040413.27813@samba.oit.unc.edu>
  6. Date: 24 Nov 92 04:04:13 GMT
  7. Sender: usenet@samba.oit.unc.edu
  8. Distribution: na
  9. Organization: University of North Carolina Extended Bulletin Board Service
  10. Lines: 25
  11. Nntp-Posting-Host: lambada.oit.unc.edu
  12.  
  13. I have been encountering a problem using the system() library routine
  14. (i.e. the routine that invokes another program or command).
  15.  
  16. I am working on a program that is spawned from another program and thus
  17. runs "in the background".  That program then will invoke certain
  18. commands via system().  It doesn't matter what the command is, but,
  19. sometimes it works just fine, and other times we get a return code of 9.
  20. (But once we get the return code of 9, all subsequent invocations also
  21. return a 9).
  22.  
  23. According to the man page, this return code could only be coming from
  24. the program executed.  Since the command executed doesn't matter, it
  25. seems like it must be coming from the shell, which I believe system()
  26. invokes to actually execute the command line specified.
  27.  
  28. I realize that 9 is the "errno" value for "not a valid file descriptor",
  29. but there's no real reason to believe that the shell returns the errno
  30. value.  I am interested in any suggestions about what might be causing
  31. this problem.
  32.                 Eli Mantel (eli.mantel@launchpad.unc.edu)
  33. --
  34.    The opinions expressed are not necessarily those of the University of
  35.      North Carolina at Chapel Hill, the Campus Office for Information
  36.         Technology, or the Experimental Bulletin Board Service.
  37.            internet:  laUNChpad.unc.edu or 152.2.22.80
  38.