Re: /dev/winchester reporting their size

Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Mon, 30 Nov 1998 10:23:44 +0000 (GMT)


On Mon, 30 Nov 1998, Tigran Aivazian wrote:

> > What's the reason for device specials not to report their sizes?

Just that it has never been done that way before, I think. And that it
doesn't always make sense. Oh, and it would require some really cludgy
code joining the device and vfs layers in ways which they aren't supposed
to.

Also think removable devices; should my floppy module get loaded and the
drive probed every time someone stats /dev/fd0? That makes ls -l /dev/ a
particularly effective DoS. You also, then, have issues with changing
metadata on r/o filesystesm.

All in all, it just doesn't really fit, I think.

> The reason is compliance with Single UNIX v2 Specification, according to
> which the st_size field of the stat structure used by stat(2) and
> friends must contain the size of the file in bytes, if the file is a
> regular file.

I don't see anything there which precludes his suggestion. Stick in an
"only" and you'd be right, but I don't remember ever seeing one...

Matthew.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/