tty: add 'active' sysfs attribute to tty0 and console device

tty: add 'active' sysfs attribute to tty0 and console device

Userspace can query the actual virtual console, and the configured
console devices behind /dev/tt0 and /dev/console.

The last entry in the list of devices is the active device, analog
to the console= kernel command line option.

The attribute supports poll(), which is raised when the virtual
console is changed or /dev/console is reconfigured.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

index 0000000..b138b66
Este commit está contenido en:
Kay Sievers
2010-12-01 18:51:05 +01:00
cometido por Greg Kroah-Hartman
padre 35c64e5d13
commit fbc92a3455
Se han modificado 5 ficheros con 87 adiciones y 6 borrados

Ver fichero

@@ -1332,6 +1332,7 @@ void register_console(struct console *newcon)
spin_unlock_irqrestore(&logbuf_lock, flags);
}
release_console_sem();
console_sysfs_notify();
/*
* By unregistering the bootconsoles after we enable the real console
@@ -1390,6 +1391,7 @@ int unregister_console(struct console *console)
console_drivers->flags |= CON_CONSDEV;
release_console_sem();
console_sysfs_notify();
return res;
}
EXPORT_SYMBOL(unregister_console);