home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / 18245 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.4 KB

  1. Xref: sparky comp.sys.sgi:18245 comp.sys.sgi.bugs:30 comp.unix.ultrix:9015
  2. Newsgroups: comp.sys.sgi,comp.sys.sgi.bugs,comp.unix.ultrix
  3. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!sgiblab!sgigate!sgi!quasar.mti.sgi.com!davea
  4. From: davea@quasar.mti.sgi.com (David B.Anderson)
  5. Subject: Re: tempnam(3S) bug, possibly on all MIPS
  6. Message-ID: <tsnt77s@sgi.sgi.com>
  7. Sender: davea@quasar.mti.sgi.com
  8. Organization: Silicon Graphics, Inc.  Mountain View, CA
  9. Date: Mon, 21 Dec 1992 17:03:10 GMT
  10. Lines: 34
  11.  
  12. In article <1gu849INNp6k@menudo.uh.edu> svec5@menudo.uh.edu (T.C. Zhao) writes:
  13. [ ]>It appears that tempnam(3S) is broken on three MIPS machines I have
  14. [ ]
  15. >   errno = 0;
  16. >   p = tempnam(0, 0);
  17. >   if(errno) fprintf(stderr," tempnam is broken\n");
  18.  
  19. The program is erroneous as various commentators have already observed.
  20.  
  21. This is specifically addressed by the ANSI/ISO C standard
  22. (using *errno* here for boldface):
  23.  
  24. ANSI C X3.159-1989
  25. ""4.1.3  Errors.
  26. ...
  27.  
  28. The Value of *errno* is zero at program startup, but is never set to
  29. zero by any library function.  The value of *errno* my be set to
  30. nonzero by a library function call whether or not there is an error,
  31. provided the use of *errno* is not documented in the description of the
  32. function in the standard."
  33.  
  34. Or see ISO/IEC 9899  7.1.4 for the identical text.
  35.  
  36. tempnam does not document the use of errno, so it can freely
  37. set errno.
  38.  
  39.  
  40.  
  41. Regards,
  42. [ David B. Anderson             (415)390-4263             davea@sgi.com ]
  43.  
  44.  
  45.  
  46.