9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] size on /proc files?
Date: Sun, 30 Mar 2003 09:48:23 -0500	[thread overview]
Message-ID: <1f9b7625d543436091d0c7dd1acb8ebc@plan9.bell-labs.com> (raw)
In-Reply-To: <091f807138892efebadcbbde9ac80bd7@plan9.bell-labs.com>

It is worth pointing out that while we don't report
the sizes for variable-length files in /proc, we 
do report some of the fixed-length ones:

--rw-rw---- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/args
--rw-r----- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/ctl
--r--r--r-- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/fd
--rw-r----- p 0 rsc rsc 108 Mar 27 00:17 /proc/1/fpregs
--r--r----- p 0 rsc rsc  76 Mar 27 00:17 /proc/1/kregs
--rw-r----- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/mem
--rw-r----- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/note
--rw-rw-r-- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/noteid
--rw-r----- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/notepg
--r--r--r-- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/ns
--r--r----- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/proc
--r--r----- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/profile
--rw-r----- p 0 rsc rsc  76 Mar 27 00:17 /proc/1/regs
--r--r--r-- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/segment
--r--r--r-- p 0 rsc rsc 176 Mar 27 00:17 /proc/1/status
--rw-r----- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/text
--r--r----- p 0 rsc rsc   0 Mar 27 00:17 /proc/1/wait

We should probably report the sizes of args, noteid, 
and notepg too.

Also, I think you're really asking about devices in
general rather than /proc in particular.  (It's only an
artifact of Linux that /dev has half moved into /proc.)

We do get a lot of the important ones right:

--rw-rw-r-- c   0 rsc    rsc          24 Mar 27 00:17 /dev/bintime
--r--r--r-- c   0 rsc    rsc          72 Mar 27 00:17 /dev/cputime
--rw-rw-r-- c   0 rsc    rsc          48 Mar 27 00:17 /dev/hostdomain
--rw-rw-rw- L   0 rsc    rsc           1 Mar 27 00:17 /dev/lpt1dlr
--r--r--r-- L   0 rsc    rsc           5 Mar 27 00:17 /dev/lpt1psr
--r--r--r-- c   0 rsc    rsc          12 Mar 27 00:17 /dev/pgrpid
--r--r--r-- c   0 rsc    rsc          12 Mar 27 00:17 /dev/pid
--r--r--r-- c   0 rsc    rsc          12 Mar 27 00:17 /dev/ppid
--rw-rw-r-- c   0 rsc    rsc          78 Mar 27 00:17 /dev/time
--r--r--r-- $   0 rsc    rsc         128 Mar 27 00:17 /dev/pci/0.0.0raw
--r--r--r-- $   0 rsc    rsc         128 Mar 27 00:17 /dev/pci/0.15.0raw
--r--r--r-- $   0 rsc    rsc         128 Mar 27 00:17 /dev/pci/0.16.0raw
--r--r--r-- $   0 rsc    rsc         128 Mar 27 00:17 /dev/pci/0.7.0raw
--r--r--r-- $   0 rsc    rsc         128 Mar 27 00:17 /dev/pci/0.7.1raw
--r--r--r-- $   0 rsc    rsc         128 Mar 27 00:17 /dev/pci/0.7.3raw

though about as many are wrong.

And of course, the disks are always right:

--rw-rw---- f   0 rsc    rsc     1474560 Mar 27 00:17 /dev/fd0disk
--rw-rw---- f   0 rsc    rsc     1474560 Mar 27 00:17 /dev/fd1disk
--rw-r----- S   0 rsc    rsc     2097152 Mar 27 00:17 /dev/sdC0/9fat
--rw-r----- S   0 rsc    rsc 48004669440 Mar 27 00:17 /dev/sdC0/data
--rw-r----- S   0 rsc    rsc 20971528704 Mar 27 00:17 /dev/sdC0/dos
--rw-r----- S   0 rsc    rsc   960700416 Mar 27 00:17 /dev/sdC0/fossil
--rw-r----- S   0 rsc    rsc  6121381888 Mar 27 00:17 /dev/sdC0/fs
--rw-r----- S   0 rsc    rsc  6123479040 Mar 27 00:17 /dev/sdC0/plan9
--rw-r----- S   0 rsc    rsc 20909629440 Mar 27 00:17 /dev/sdC0/plan9.1
--rw-r----- S   0 rsc    rsc 16727702528 Mar 27 00:17 /dev/sdC0/v.arenas
--rw-r----- S   0 rsc    rsc   805306368 Mar 27 00:17 /dev/sdC0/v.index0
--rw-r----- S   0 rsc    rsc   805306368 Mar 27 00:17 /dev/sdC0/v.index1
--rw-r----- S   0 rsc    rsc   805306368 Mar 27 00:17 /dev/sdC0/v.index2
--rw-r----- S   0 rsc    rsc   805306368 Mar 27 00:17 /dev/sdC0/v.index3

I'm curious: if you use devfs on Linux, do you get sizes for
some of the devices when you stat them?  Seems like it
would be easy in that framework.

Russ



  parent reply	other threads:[~2003-03-30 14:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-30 10:36 Aharon Robbins
2003-03-30 12:34 ` David Presotto
2003-03-30 12:48   ` David Presotto
2003-03-30 14:48   ` Russ Cox [this message]
2003-03-31  9:08   ` Aharon Robbins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f9b7625d543436091d0c7dd1acb8ebc@plan9.bell-labs.com \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).