holes in files

Barry Shein bzs at world.std.com
Sun Dec 16 10:20:20 AEST 1990


Although this doesn't work in practice it seems that getrusage()'s
ru_inblocks ought to tell you the actual number of blocks read, in
which case that number wouldn't increment when you read a hole. So you
could watch your rusage structure to detect holes.

Right now ru_inblocks doesn't increment when the block was in the
cache, which I suppose is honest in some sense, but I don't think it
would be too odd if the only case it didn't increment on were when a
hole was read.

Perhaps that would take another structure element (one to indicate
blocks read by the process and another to indicate how many blocks
actually had to be retrieved from a device or were already in the
cache, either way.)
-- 
        -Barry Shein

Software Tool & Die    | {xylogics,uunet}!world!bzs | bzs at world.std.com
Purveyors to the Trade | Voice: 617-739-0202        | Login: 617-739-WRLD



More information about the Comp.unix.internals mailing list