lkml.org 
[lkml]   [1999]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: [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/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.036 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site