How to get login shell pid's

Steven List itkin at luke.UUCP
Wed Oct 2 05:43:42 AEST 1985


In article <4 at andromeda.UUCP> dave at andromeda.UUCP (Dave Bloom) writes:
>I'm writing my own version of "idledaemon" but I'd like a few suggestions from
>the net. Namely, what's the best way to get the pid of a users login shell? The
>SystemV command 'who -u' supplies the number, but I can't find anything in the
>4.2 BSD universe that does the same. Any suggestions? Any idea how AT&T does
>it in 'who', and can it be done similarly in 4.2 BSD?

System V (and III) use /etc/utmp to store information about logged in users.
There is an include file <utmp.h> described in section 4 of the Programmer
Reference Manual that describes the structure of each /etc/utmp entry.

As I recall, in S5 there is also a set of functions that will read and
write /etc/utmp for you.
-- 
***
*  Steven List @ Benetics Corporation, Mt. View, CA
*  Just part of the stock at "Uncle Bene's Farm"
*  {cdp,greipa,idi,oliveb,sun,tolerant}!bene!luke!itkin
***



More information about the Comp.unix mailing list