xseek(y,z,0) .vs. xseek(y,z,1)
Chris Torek
chris at mimsy.UUCP
Fri Jun 10 00:28:34 AEST 1988
In article <1988Jun7.162241.14545 at utzoo.uucp> henry at utzoo.uucp
(Henry Spencer) writes:
>In most implementations it isn't going to make any difference, because the
>1 case is converted into the 0 case before anything else is done.
Actually, in at least one implementation (4.[23]BSD), fseek(..., 0) is
often slower than fseek(..., 1), because 0 (L_SET) calls lseek() once
to find out where the offset is now, in case data in a pre-read buffer
is already correct, then again if the data is not useful (belongs to
the wrong region of the file).
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.lang.c
mailing list