Messages in this thread | | | From | Kay Sievers <> | Date | Tue, 16 Nov 2010 17:13:07 +0100 | Subject | Re: tty: add 'active' sysfs attribute to tty0 and console device |
| |
On Tue, Nov 16, 2010 at 16:57, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > On Tue, 16 Nov 2010 16:46:40 +0100 > Kay Sievers <kay.sievers@vrfy.org> wrote: > >> commit be0d5f02c9194fe41c1aad11d7282db117bda938 >> Author: Kay Sievers <kay.sievers@vrfy.org> >> Date: Tue Nov 9 18:53:59 2010 +0100 >> >> tty: add 'active' sysfs attribute to tty0 and console device > > This is all somewhat weird. > >> Userspace can query the actual virtual console, and the configured >> console devices behind /dev/tt0 and /dev/console. > > All the other vt interface code is in the vt driver, the ioctls for it > are in the vt driver and a query about what is the active vt only has > meaning within that context as you need to post a waitevent first to > track changes during the query. So if you need a VT_GETACTIVE interface > put it in the tty ioctls where it can be properly locked and used. > >> +What: /sys/class/tty/tty0/active >> +Date: Nov 2010 >> +Contact: Kay Sievers <kay.sievers@vrfy.org> >> +Description: >> + Shows the currently active virtual console >> + device, like 'tty1'. >> + The file supports poll() to detect virtual >> + console switches. > > NAK this, its a nonsense interface > > Seriously what use is an interface that tells you "what the console might > have been", this is why we have a proper event tracking interface instead.
You mean the VT_WAITEVENT? Sleeping ioctls() can't be used. The time between the check for the current, and you go to sleep in the ioctl() for teh next is a window which isn't covered with such interface.
And 'might have been' does not matter, it's fine. We just need change notification, and can query the actual vt again.
Kay -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |