Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.windows.x Subject: Re: Why does every xterm create an entry in /usr/utmp? Message-ID: <2421@auspex.auspex.com> Date: 7 Sep 89 18:14:50 GMT References: <3472@blake.acs.washington.edu> <8909051759.AA11810@gaak.LCS.MIT.EDU> <16851@pasteur.Berkeley.EDU> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 25 >Anyway, for the 'Sprite' operating system currently being developed here at >Berkeley someone just hacked 'finger' to display just the login with the least >idle time (unless you indicate that you want the whole story by specifying >a suitable option). Looks like a sensible solution to me. A better solution is the one used by the SunOS "finger" - if you're fingering the user on "/dev/console", it looks at "/dev/kbd" and "/dev/mouse" as well, and takes the minimum of the idle time of those three. This, of course, requires that there be some special files in "/dev" whose time of last access gets updated whenever your window system (X server, whatever) does a successful "read" on the input device in question. (It also hardcodes some knowledge into "finger" that ideally shouldn't be there.) The advantage of that is that it counts *all* input, even if it wasn't typed into a pseudo-tty; i.e., it counts input to all window system programs from the keyboard or mouse. Another trick done in some SunOS utilities is to recognize "utmp" entries that belong to tty emulator windows, not login sessions; a "nonuser" entry (see the "nonuser" macro in ) is an entry that corresponds to a pseudo-tty (i.e., is of the form "tty[pqrs]...") and has an empty "ut_host" field. Of course, this doesn't work for "xterm"s, since they fill in the "ut_host" field....