Subject: Re: RFC: /kern/summary
To: None <tech-kern@netbsd.org>
From: Olaf Seibert <rhialto@polder.ubc.kun.nl>
List: tech-kern
Date: 03/10/1999 16:44:00
> > 	This
> > 	allows one to do a read() of this amount, and hopefully
> > 	grab an atomic snapshot in a single syscall, rather
> > 	than reading the first 1024 bytes of the file, then
> > 	later reading the second 1024 bytes, leading to bogus
> > 	values at the buffer boundary due to the change in stats
> > 	between the two calls.
> 
> Ew! This totally violates the notion of least surprise. If you open
> the file, your instance of it should never change out from under you
> until you do something to allow that to happen like closing it.

Perhaps it is useful to make the lines in the file semi-fixed format: if
the values change, they will stay in the same seek offsets. This may
require padding with zeros or spaces of course. You may try to determine
the required space at boot time, or you could be lazy and just reserve
"plenty" and just always pad.

Advantage: If some userland program is interested in just one (or a few)
value(s), it would need to find the relevant offsets only once and
re-read selectively thereafter. For the file system it will be easier to
determine what to send to userland if userland reads from some random
seek offset.

-Olaf.
--
___ Olaf 'Rhialto' Seibert - rhialto@polder.ubc. ---- Unauthorized duplication,
\X/ .kun.nl ---- while sometimes necessary, is never as good as the real thing.