stdio.h problem on 4.0 (was News 2.11.19...)

Chris Torek chris at mimsy.umd.edu
Fri Sep 14 22:03:46 AEST 1990


In article <1990Sep13.084901 at epb2.lbl.gov>
envbvs at 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 at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.ultrix mailing list