Subject: Re: RFC: /kern/summary
To: Soren S. Jorvang <soren@t.dk>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 03/10/1999 11:26:58
>With something like this, we could also easily have a sysctl that
>says 'you can only get information about (see) your own processes'
>or various levels around that.
>
>I have been trying to see how other systems that have such a syscall
>do it. AIX has getprocs(). Does anyone know of others?

dgux.  about five years ago i tried to build lsof or ofiles on dgux
for some late night turnaround stuff (kill all processes still reading
this dead file kind of stuff) and (a) never succeeded since dgux is so
ugly but (b) ended up reading so many header file and man pages in the
atttempt that i was then able to write something simple from scratch
that did roughly the same thing.

it ran as any old user, with no privs.  dgux has some "proprietary"
system calls such as dgux_getprocesslist(...), where the ... is a
version number, a bunch of flags, probably a pointer, and a pointer to
an integer (or something like that, i don't really remember).

it then iterated over what it got back calling a few other kooky
functions that got the open file descriptors list for a given process
and then stat()ed each fd in turn to find out what they were up to.

ugly stuff.  <shudder>

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."