Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!apple!bbn!bbn.com!rsalz From: rsalz@bbn.com (Rich Salz) Newsgroups: comp.os.minix Subject: Re: POSIX Message-ID: <2091@prune.bbn.com> Date: 27 Oct 89 14:26:19 GMT References: <3819@ast.cs.vu.nl> <1989Oct26.143100.4916@world.std.com> <3842@math.cs.vu.nl> Organization: BBN Systems and Technologies Corporation Lines: 25 In article <3819@ast.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes: >with a dirp that has already been closed, closedir() assumes that dirp >points to a valid DIR Both Jim Frost (<1989Oct26.143100.4916@world.std.com>) and I () don't think this is a bug. In <3842@math.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes: >Perhaps it wasn't a bug previously, but has to be regarded as a bug now >because POSIX explicitly requires a call to closedir() with a rotten >argument to return EBADF, not to crash, trap or do anything else. (See >Sec. 5.1.2.4 of P1003.1). If closedir() is not implemented as a syscall, then the only portable way to handle this is to keep a list of everything you ever opendir'd, and a flag as to whether it's still valid or not. Magic numbers just ain't foolproof. Posix blew it on this one; they should have defined it to be undefined action. /r$ -- Please send comp.sources.unix-related mail to rsalz@uunet.uu.net. Use a domain-based address or give alternate paths, or you may lose out.