Messages in this thread | | | Date | Mon, 15 Mar 1999 01:58:39 -0800 (PST) | From | Jeremy Fitzhardinge <> | Subject | RE: [patch] bugfix for fs/proc/array.c FIXME tasklist_lock |
| |
On 15-Mar-99 Tigran Aivazian wrote: > I think read_maps() violates the ancient tradition of UNIX - "a regular > file is just a stream of bytes". I tried to read(2) from /proc/<pid>/maps > 49 bytes at a time and I get sometimes 49 and sometimes 3 bytes - i.e. a > record structure is imposed, where, imho, it should NOT have been.
The ancient tradition of Unix is that read() is allowed to return as many bytes as it wants (0 < bytes read <= bytes asked for). Mostly it can return the exact number you ask for when you read files from disk, but sometimes it doesn't. Programs just have to deal with it.
Note that /proc/<pid>/maps *does* have a record-oriented structure, and that's just the nature of the beast.
J
- 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/
| |