Re: tty idle time and hooking inode_ops from a chardev

From: Phillip Susi
Date: Fri Dec 16 2011 - 14:50:04 EST


On 12/16/2011 1:36 PM, Greg KH wrote:
As you are opening the tty node once, that's when atime is set, right?
The fact that you keep it open still keeps the atime to the original
open time, you aren't supposed to check for every single read/write of
the node once it was opened.

But to be sure, what does POSIX say about this?

Actually it looks like POSIX 4.8 "File Times Update" requires the timestamps to be updated on every read/write, which is probably why Linux does that.

So the problem is just the /dev/tty alias having a different inode than the actual controlling tty. It also makes the output of lsof less useful, so maybe the real fix is to somehow make opening /dev/tty actually open the correct tty inode and dentry.

I have a feeling that will require changing /dev/tty from being a devnode to a symlink to something in /dev/pts.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/