Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!munnari.oz.au!bruce!cechew From: cechew@bruce.OZ (Earl Chew) Newsgroups: comp.os.minix Subject: Re: POSIX Message-ID: <1687@bruce.OZ> Date: 13 Nov 89 00:58:52 GMT References: <12288@fluke.COM> Organization: Monash Uni. Computer Science, Australia Lines: 33 From article <12288@fluke.COM>, by dcd@tc.fluke.COM (David Dyck): > "Std 1003.3 - Draft 7.0 TEST METHODS for MEASURING CONFORMANCE to POSIX 1003.1" > (NOTE: this is still in DRAFT form) > and looked up the documentation for closedir that ast mentioned October 25th. > It states (under section 5.1.2.4 Errors) > > "On a call to closedir(dirp) when the dirp argument does not refer to an open > directory streem, shall return a value of -1 and set "errno" to {EBADF}." This is in direct contradiction to Std 1003.1-1988 Sec B.5.1.2: "Since the strcutre and buffer allocation, if any, for directory operations are defined by the implementation, the standard imposes no portability requirements for erroneous program constructs, erroneous data, or the use of indeterminate values such as the use or referencing of a dirp value or a dirent structure value after a directory stream has been closed or after a fork() or one of the exec function calls." The wording *very* clear on this point. Furthermore, Std 1003.1-1988 Sec 5.1.1.2: "If the dirp argument passed to any of these functions does not refer to a currently-open directory stream, the effect is undefined." Thus the implementation (Minix) can do whatever it likes (ie check or not check). Earl -- Earl Chew, Dept of Computer Science, Monash University, Australia 3168 ARPA: cechew%bruce.cs.monash.oz.au@uunet.uu.net ACS : cechew@bruce.oz ----------------------------------------------------------------------