Re: size of files in /proc

Kevin Lentin (
Wed, 20 May 1998 12:20:25 +1000

On Tue, May 19, 1998 at 09:38:27PM +0000, Ton Hospel wrote:
> But even then I'd like /proc to report the unknown sizes as 1, not 0.
> Because I like to be able to export /proc over NFS, and NFS doesn't even
> bother to read the file if the size is 0.

Now that sounds like a real problem. Question is: is that nfs that is
broken or /proc. I can see arguments both ways.
Does nfs do a stat on each file before a read? What if it knows the file
pointer is at EOF, does it refuse to read the file? Surely, if you ask nfs
to read, it has to either go out and stat and then refuse or just try the
read. Sounds like trying the read would be less work.

Another problem with reporting sizes on the textual files is that you can
write to them. Having a size of 1 and allowing you to write arbitrary text
into the file without disturbing that 1 seems strange. Makes a little more
sense with 0.

I suppose the best way of doing it would be to make them pipes instead of
files since their behaviour in many cases is more like a pipe into the
kernel than a file.

[     Kevin Lentin               Email:      ]
[   finger for PGP public key block.   ]
[  KeyId: 06808EED    FingerPrint: 6024308DE1F84314  811B511DBA6FD596  ]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to