Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Sep 1997 16:12:06 -0500
From:      Wm Brian McCane <root@bmccane.uit.net>
To:        Daniel Ortmann <ortmann@sparc.isl.net>
Cc:        current@FreeBSD.ORG
Subject:   Re: Does this idea have merit? 
Message-ID:  <199709162112.QAA11887@bmccane.uit.net>
In-Reply-To: Your message of "Sat, 13 Sep 1997 12:39:47 CDT." <199709131739.MAA00426@watcher.isl.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Since 'ps' is often run to find
> - all processes belonging to a user,
> - or all processes with a particular controlling tty,
> - or which instances of a binary are running (i.e. how many instances
>   of 'spice' circuit simulations are running)
> 
> ... would it make sense to enhance procfs to provide /proc/users/,
> /proc/users/binaries/, /proc/ttys/, and /proc/binaries/?  Under
> these dirs we could perhaps have symlinks to the "real" processes.
> 
> (Part of my motivation is to get the information from a scripting
> language such as perl ... without writing extensions.)
> 
> On the other hand, maybe I'm missing something basic.  Is there
> some other way to find out (without forking a /bin/ps):
> - the names and process info of all a user's processes?
> - the names and process info of all processes?
> - which processes are controlled by a given tty?
> - which processes have a given uid?

You can get the ownership by doing an `ls -l' in /proc.  Or use `readdir' and 
`stat' in perl to get the owner ID.

	brian





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709162112.QAA11887>