Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!ast From: ast@cs.vu.nl (Andy Tanenbaum) Newsgroups: comp.os.minix Subject: Re: POSIX Message-ID: <4130@ast.cs.vu.nl> Date: 27 Oct 89 22:09:49 GMT References: <3819@ast.cs.vu.nl> <1989Oct26.143100.4916@world.std.com> <3842@math.cs.vu.nl> <2091@prune.bbn.com> Reply-To: ast@cs.vu.nl (Andy Tanenbaum) Organization: VU Informatica, Amsterdam Lines: 17 In article <2091@prune.bbn.com> rsalz@bbn.com (Rich Salz) writes: >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. No. It is sufficient to keep a list of all the ones that are still open. When someone does a close, you check the list and if it is not on it, you return EBADF. My quickie solution is only 65535/65536-ths correct, but I find the code too hairy to change in any serious way. >Posix blew it on this one; they should have defined it to be undefined I disagree. I think every incorrect call should return an error and the standard should specify which error it is, to allow applications to test for that specific error. In almost all other parts of the standard they specified the error returns, so why not here. Andy Tanenbaum (ast@cs.vu.nl)