bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10306: who and idle time


From: Phillip Susi
Subject: bug#10306: who and idle time
Date: Thu, 15 Dec 2011 21:58:25 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0

-----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-----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]