GNU bug report logs - #10306
who and idle time

Previous Next

Package: coreutils;

Reported by: Phillip Susi <psusi <at> cfl.rr.com>

Date: Fri, 16 Dec 2011 03:01:02 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Phillip Susi <psusi <at> cfl.rr.com>
To: bug-coreutils <at> gnu.org
Subject: who and idle time
Date: Thu, 15 Dec 2011 21:58:25 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've long wondered why the idle time reported by who is sometimes wrong, mostly with X terminals, and also I recently noticed, when running emacs or less.  I was shocked to see that the time is found by checking the atime of the tty device.  The reason it is sometimes not updated is because emacs and less open /dev/tty, which is effectively whichever controlling tty they are attached to, except that it is a different inode, and so the read()s update the atime of /dev/tty instead of /dev/ttyXX.  At first I thought that I could fix this, but now it occurs to me that the whole concept is fundamentally flawed because you can have multiple inodes that all point to the same chardev, so which one should get updated?

Shouldn't the kernel tty driver keep track of idle time and let you read it with an ioctl?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJO6rPGAAoJEJrBOlT6nu75PhEH/31JO8TYXhuqYon1lXj1B9qf
brCSzahX+gIU9uZoN4YQzKywnSOH4niVntnGfElifdORPJOdpfUbrjrQ6uRfpg5r
t5gA1BfA9y6Dz6WxI/BHPyyLzpkWIHAFjEkNM8D6QoSNpSZWX4lqpr1mO4V18vPs
pKU6bx7GxUAo+VWehmgMwrVkYAozBY/AS+gnoHoOs8mIHxl/OQ5n63Zpf0CJM1Gb
nxON6AJnmh//pq1G1qTV9sLQjAripeS4l4T08+DcKQ0+oCf+iBx7aNrMvHdKLzqP
VsVO/WWmhu3PEOcjYAy+1/smkuAM+xP6X8iPR1Hd+PLXmGyprZNm+LlzkHDRzd4=
=e8D9
-----END PGP SIGNATURE-----




This bug report was last modified 13 years and 190 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.