Subject: kern/31430: ptyfs isn't getting mtime right
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Simon Burge <simonb@wasabisystems.com>
List: netbsd-bugs
Date: 09/30/2005 14:42:00
>Number:         31430
>Category:       kern
>Synopsis:       ptyfs isn't getting mtime right
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 30 14:42:00 +0000 2005
>Originator:     Simon Burge <simonb@wasabisystems.com>
>Release:        NetBSD 3.99.9, 29 Sep 2005 sources
>Organization:
Wasabi Systems
>Environment:
System: NetBSD euclid 3.99.9 NetBSD 3.99.9 (EUCLID) #504:
  Thu Sep 29 12:39:36 EST 2005
  simonb@euclid:/home/netbsd/obj/sys/arch/i386/compile/EUCLID i386
Architecture: i386
Machine: i386
>Description:
	It seems that ptyfs doesn't track the modification time of
	a pty until it has been queried at least once by stat(2).

	For example, on one pty:

    euclid 30> tty
    /dev/pts/2
    euclid 31> date
    Sat Oct  1 00:22:22 EST 2005

	and then on another pty:

    euclid 31> tty
    /dev/pts/1

    euclid 32> date ; ls -lT /dev/pts/[12]
    Sat Oct  1 00:32:07 EST 2005
    crw--w----  1 simonb  tty  5, 1 Oct  1 00:32:07 2005 /dev/pts/1
    crw--w----  1 simonb  tty  5, 2 Oct  1 00:32:07 2005 /dev/pts/2

    euclid 33> date ; ls -lT /dev/pts/[12]
    Sat Oct  1 00:32:17 EST 2005
    crw--w----  1 simonb  tty  5, 1 Oct  1 00:32:17 2005 /dev/pts/1
    crw--w----  1 simonb  tty  5, 2 Oct  1 00:32:07 2005 /dev/pts/2

    euclid 34> date ; ls -lT /dev/pts/[12]
    Sat Oct  1 00:37:38 EST 2005
    crw--w----  1 simonb  tty  5, 1 Oct  1 00:37:38 2005 /dev/pts/1
    crw--w----  1 simonb  tty  5, 2 Oct  1 00:32:07 2005 /dev/pts/2

	Notice that /dev/pts/2 says 00:32:07 (the time of the first
	ls) and then stays at that time, and not 00:22:22 like it
	should show?


>How-To-Repeat:
	Log in to a machine twice, leave one session idle.  Wait a
	little while, then type "w" in the other session and notice
	that both sessions have 0 idle time.

>Fix:
	None given.