[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] Was: /proc, will be: /sys



On Thu, Nov 11, 1999 at 06:23:29PM +0200, Martin-Eric Racine wrote:
> A question for the real gurus:
> 
> Why does /proc shows process names as truncated filenames?
> 
> For example, both rpc.mountd and rpc.nfsd show up as rpc.<PID>
> instead of rpc.mountd.<PID> and rpc.nfsd.<PID> and same thing for
> in.telnetd which shows up as in.<PID> instead of in.telnetd.<PID>
> as I would have expected.
> 
> This also affects how 'ps' displays the process names, btw.

All true, all unsatisfying. I thought about extending the /proc filesystem
but gave up the idea after I have realized how many programs rely on the
current restrictions.

I have therefore started (in fact I'm relatively far with that) a new
pseudo-filesystem called "/sys" which has many features from the "/proc"
filesystem used on Linux.  Inside "/sys" there is a subdirectory (named
after the process id) for each process in the system.  This subdirectory
contains all the information you want in form of human-readable files, for
example

	bash-2.03$ cat /sys/123/cmdline | tr '\0' ' '
	find / -name *.tmp -print
	bash-2.03$ cat /sys/123/environ | tr '\0' '\n'
	USER=guido
	PWD=/home/guido
	TERM=tw52
	...

There are many more files than "cmdline" and "environ", you will be able
to retrieve every information the kernel itself has about the process.

If you are lucky (and if I find some more time) one of the next MiNT
versions will feature this pseudo-filesystem.

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000/
mailto:gufl0000@stud.uni-sb.de