But, in fact, you can get a similar effect by mapping
from a common file. If the last process to map the
file also unlink()s it, then the inode will be automatically
cleaned up when the last process using the file exits (or
closes the fd).
My only question on this is: is it possible for Linux
to notice when an inode is not linked to an actual
directory entry and never bother to synchronise that
`file' when sync() is called? This would be an optimization
in several situations - for the mmap case above (writes
to the shared memory wouldn't ever be written out to
the disk), and for various daemons that open temporary
files on /tmp and immediately unlink them. Again, there's
no need to actually write anything to the disk in this
case. If there's enough memory spare, then the dirty disk
blocks can just accumulate in memory.
Rich.
-- Richard Jones rjones@orchestream.com Tel: +44 171 460 6141 Fax: .. 4461 Orchestream Ltd. 262a Fulham Rd. London SW10 9EL. "you'll write in PGP: www.four11.com telegraphic, or you won't write at all" [Céline] Copyright © 1998 Richard W.M. Jones