home *** CD-ROM | disk | FTP | other *** search
- From: simon@its63b.ed.ac.uk (Simon Brown)
-
- In article <8271@ut-sally.UUCP> Doug Gwyn (VLD/VMB) <gwyn@BRL.ARPA> writes:
- >From: Doug Gwyn (VLD/VMB) <gwyn@BRL.ARPA>
- >
- >I submitted a proposal to X3J11 that fflush((FILE*)NULL) would
- >flush ALL output buffers, since there is no other good way to
- >accomplish that. It seems that close(-1) might be a similar
- >solution for POSIX. (Since nobody is supposed to be doing this
- >currently, it is available for assigning new semantics to.)
- >
-
- Arghhh, no! Don't do that! Ok, it might seem a truly wonderful idea, but
- it would mean that things like
- fd = open(some-random-filename,something);
- do-something-bizarre-with-fd;
- close(fd);
- will do a "close(-1)" if the open happened to fail for some reason or other,
- which is harmless at the moment (just returns -1, errno=EBADF), but would be
- a bit tragic with this new semantics!
- Yes, I know this isn't a problem if everyone always checks the return-value
- from open(), creat(), etc..., but lots of programs aren't that pessimistic!
-
- --
- ----------------------------------
- | Simon Brown | UUCP: seismo!mcvax!ukc!{its63b,cstvax}!simon
- | Department of Computer Science | JANET: simon@uk.ac.ed.{its63b,cstvax}
- | University of Edinburgh, | ARPA: simon%{its63b,cstvax}.ed.ac.uk ...
- | Scotland, UK. | @cs.ucl.ac.uk
- ---------------------------------- "Life's like that, you know"
-
- Volume-Number: Volume 11, Number 74
-
-