Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!ubvax!vsi1!wyse!mips!dce
From: dce@mips.COM (David Elliott)
Newsgroups: comp.unix.questions
Subject: Re: How do you know if a user is idle?
Keywords: idle accounting
Message-ID: <2551@quacky.mips.COM>
Date: 6 Jul 88 13:56:33 GMT
References: <529@amc-vlsi.UUCP>
Reply-To: dce@quacky.UUCP (David Elliott)
Organization: MIPS Computer Systems, Sunnyvale, CA
Lines: 13

In article <529@amc-vlsi.UUCP> earl@doc.uucp (Earl Locken) writes:
>
>How does the system tell if a user is idle?  We run SunOS here, and
>where does the "w" command get the info it prints as the idle time?

Both "w" and "rwhod" get the idle time by stat()ing the tty device
and subtracting the last access time (st_atime) from the current time.

This method works in both BSD and System V (at least, in our System
V, which has rwho in it).

-- 
David Elliott		dce@mips.com  or  {ames,prls,pyramid,decwrl}!mips!dce