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

  1. Xref: sparky comp.unix.wizards:4817 comp.unix.shell:4821 comp.unix.misc:4274
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!ames!agate!doc.ic.ac.uk!uknet!root44!gwc
  3. From: gwc@root.co.uk (Geoff Clare)
  4. Newsgroups: comp.unix.wizards,comp.unix.shell,comp.unix.misc
  5. Subject: Re: The Problem with UNIX
  6. Message-ID: <By10D6.1Mz@root.co.uk>
  7. Date: 20 Nov 92 17:53:29 GMT
  8. References: <1992Nov11.194557.16258@yarc.uucp> <1992Nov12.204710.5808@reed.edu> <1992Nov16.234721.3224@nic.csu.net> <1992Nov18.110609.9149@thunder.mcrcim.mcgill.edu>
  9. Organization: UniSoft Ltd., London, England
  10. Lines: 25
  11.  
  12. mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
  13.  
  14. >All of these are available:
  15.  
  16. >%s    argv[0],
  17. >%s    ((errno>0)&&(errno<sys_nerr))?sys_errlist[errno]:"Unknown error"
  18. >%d    getpid()
  19.  
  20. Better make that:
  21.  
  22.     %ld   (long)getpid()
  23.  
  24. since getpid() returns a pid_t on modern systems, and pid_t can be
  25. either int or long.
  26.  
  27. >Of course, this helps only when errno contains something useful.  Far
  28. >too many things don't do this - fopen, for example, does not have
  29. >anything to do with errno as any part of its contract....
  30.  
  31. Out of date again.  POSIX requires fopen() to set errno the same as
  32. open() does.
  33.  
  34. -- 
  35. Geoff Clare <gwc@root.co.uk> (USA antiquated mailers: ...!uunet!root.co.uk!gwc)
  36. UniSoft Limited, London, England.   Tel: +44 71 729 3773   Fax: +44 71 729 3273
  37.