home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sgi:18245 comp.sys.sgi.bugs:30 comp.unix.ultrix:9015
- Newsgroups: comp.sys.sgi,comp.sys.sgi.bugs,comp.unix.ultrix
- Path: sparky!uunet!spool.mu.edu!darwin.sura.net!sgiblab!sgigate!sgi!quasar.mti.sgi.com!davea
- From: davea@quasar.mti.sgi.com (David B.Anderson)
- Subject: Re: tempnam(3S) bug, possibly on all MIPS
- Message-ID: <tsnt77s@sgi.sgi.com>
- Sender: davea@quasar.mti.sgi.com
- Organization: Silicon Graphics, Inc. Mountain View, CA
- Date: Mon, 21 Dec 1992 17:03:10 GMT
- Lines: 34
-
- In article <1gu849INNp6k@menudo.uh.edu> svec5@menudo.uh.edu (T.C. Zhao) writes:
- [ ]>It appears that tempnam(3S) is broken on three MIPS machines I have
- [ ]
- > errno = 0;
- > p = tempnam(0, 0);
- > if(errno) fprintf(stderr," tempnam is broken\n");
-
- The program is erroneous as various commentators have already observed.
-
- This is specifically addressed by the ANSI/ISO C standard
- (using *errno* here for boldface):
-
- ANSI C X3.159-1989
- ""4.1.3 Errors.
- ...
-
- The Value of *errno* is zero at program startup, but is never set to
- zero by any library function. The value of *errno* my be set to
- nonzero by a library function call whether or not there is an error,
- provided the use of *errno* is not documented in the description of the
- function in the standard."
-
- Or see ISO/IEC 9899 7.1.4 for the identical text.
-
- tempnam does not document the use of errno, so it can freely
- set errno.
-
-
-
- Regards,
- [ David B. Anderson (415)390-4263 davea@sgi.com ]
-
-
-
-