NFS performance
Guy Harris
guy at auspex.auspex.com
Sat Jul 21 07:06:47 AEST 1990
> (1) In SunOS 4.0 (and higher), cat doesn't actually do reads in
> the case where the output goes to /dev/null.
Just in case anybody was about to interpret this as meaning that "cat"
special-cases "/dev/null":
For those not aware of how this happens, "cat" in 4.0 "mmap()"s the
file(s) being concatenated, if it can, and just writes from the
mapped-in areas (mapped 1MB at a time, as I remember). This means that
the handler for the object being written to, in effect, does all the
reading, by faulting in the data from the file; since the handler for
"/dev/null" never looks at the data being written, it's never faulted
in.
More information about the Comp.unix.wizards
mailing list