summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons/syscons.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/syscons/syscons.c')
-rw-r--r--sys/dev/syscons/syscons.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 02c771a..09f35bb 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -981,6 +981,13 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
*(int *)data = scp->index + 1;
return 0;
+ case VT_LOCKSWITCH: /* prevent vty switching */
+ if ((*(int *)data) & 0x01)
+ sc->flags |= SC_SCRN_VTYLOCK;
+ else
+ sc->flags &= ~SC_SCRN_VTYLOCK;
+ return 0;
+
case KDENABIO: /* allow io operations */
error = suser(td);
if (error != 0)
@@ -2075,6 +2082,13 @@ sc_switch_scr(sc_softc_t *sc, u_int next_scr)
DPRINTF(5, ("sc0: sc_switch_scr() %d ", next_scr + 1));
+ /* prevent switch if previously requested */
+ if (sc->flags & SC_SCRN_VTYLOCK) {
+ sc_bell(sc->cur_scp, sc->cur_scp->bell_pitch,
+ sc->cur_scp->bell_duration);
+ return EPERM;
+ }
+
/* delay switch if the screen is blanked or being updated */
if ((sc->flags & SC_SCRN_BLANKED) || sc->write_in_progress
|| sc->blink_in_progress || sc->videoio_in_progress) {
OpenPOWER on IntegriCloud