Messages in this thread | | | Date | Tue, 22 Oct 2002 11:10:29 -0400 (EDT) | From | "Richard B. Johnson" <> | Subject | Re: 2.4.20-pre11 /proc/partitions read |
| |
On Tue, 22 Oct 2002, Jan Kasprzak wrote:
> Hello, world!\n > > while trying to figure out why my "vgchange -a y" sometimes works > and sometimes does not, I've come to the following problem: > > # dd if=/proc/partitions bs=512|wc -l > 1+1 records in > 1+1 records out > 12 > > # dd if=/proc/partitions bs=128k|wc -l > 0+1 records in > 0+1 records out > 32 > > > I.e. if you read the /proc/partitions in single read() call, > it gets read OK. However, if you read() with smaller-sized blocks, > you get the truncated contents. > > Are applications expected to read the whole /proc file > in one read()? > > -Yenya >
Well yes, sorta. The proc file-system is a compromise. You can `cat` it and `more` it, but anything that uses `lseek` will fail in strange ways.
Cheers, Dick Johnson Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips). The US military has given us many words, FUBAR, SNAFU, now ENRON. Yes, top management were graduates of West Point and Annapolis.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |