From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <58a8262f422a9bc5d33049fcd39ae124@plan9.bell-labs.com> From: David Presotto To: 9fans@cse.psu.edu Subject: Re: [9fans] size on /proc files? In-Reply-To: <091f807138892efebadcbbde9ac80bd7@plan9.bell-labs.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Sun, 30 Mar 2003 07:48:23 -0500 Topicbox-Message-UUID: 86f4e994-eacb-11e9-9e20-41e7f4b1d025 Thinking a bit more on it and looking at devproc.c and sysproc.c, the text size is easy to get right, it's in the text segment. The process is a bit more problematic since the address space is sparse. The text/data/bss are at one end (right after an invalid page to catch null regs), the stack at the other, and other segs anywhere in between. The easy thing would be to say all procs are 0x7ffff000 bytes long. That would help your get_a_record routine but wouldn't really be very informative. You'ld be better off reading the segment file to see what is and isn't there than just checking a length of the mem file.