Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site luke.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!oliveb!bene!luke!itkin From: itkin@luke.UUCP (Steven List) Newsgroups: net.unix Subject: Re: How to get login shell pid's Message-ID: <338@luke.UUCP> Date: Tue, 1-Oct-85 15:43:42 EDT Article-I.D.: luke.338 Posted: Tue Oct 1 15:43:42 1985 Date-Received: Thu, 3-Oct-85 06:26:08 EDT References: <4@andromeda.UUCP> Reply-To: itkin@luke.UUCP (Steven List) Organization: Benetics Corp, Mt.View, CA Lines: 19 Summary: In article <4@andromeda.UUCP> dave@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 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 *** Brought to you by Super Global Mega Corp .com