Path: utzoo!attcan!uunet!crdgw1!uakari.primate.wisc.edu!samsung!usc!elroy.jpl.nasa.gov!ames!dftsrv!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.ultrix Subject: Re: stdio.h problem on 4.0 (was News 2.11.19...) Message-ID: <26545@mimsy.umd.edu> Date: 14 Sep 90 12:03:46 GMT References: <421@ucunix.SAN.UC.EDU> <21955@grebyn.com> <1990Sep13.084901@epb2.lbl.gov> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 13 In article <1990Sep13.084901@epb2.lbl.gov> envbvs@epb2.lbl.gov (Brian V. Smith) writes: >Also, as Marcus Ranum of DEC says, "assigning a value to fileno is evil." >The answer is to change the "fileno(fp) = -1;" to "fp->_file = -1;" >and "fileno(fp) = fno;" to "fp->_file = fno;" This really is no better: assigning to _file is just as bad. (Nowhere in the documentation does anything say that there *is* a _file field, so the implementation is free to change this.) The real solution is to change the algorithm. Unfortunately, the hack is much easier. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris