1 /* all.c -- console grabbing plugin for vlock,
2 * the VT locking program for linux
4 * This program is copyright (C) 2007 Frank Benkstein, and is free
5 * software which is freely distributable under the terms of the
6 * GNU General Public License version 2, included as the file COPYING in this
7 * distribution. It is NOT public domain software, and any
8 * redistribution not permitted by the GNU General Public License is
9 * expressly forbidden without prior written permission from
19 #include <sys/ioctl.h>
23 #include "vlock_plugin.h"
24 #include "console_switch.h"
26 bool vlock_start(void __attribute__((unused
)) **ctx_ptr
)
28 if (!lock_console_switch()) {
29 if (!lock_console_switch()) {
30 if (errno
== ENOTTY
|| errno
== EINVAL
)
31 fprintf(stderr
, "vlock-all: this terminal is not a virtual console\n");
33 fprintf(stderr
, "vlock-all: could not disable console switching: %s\n", strerror(errno
));
37 return console_switch_locked
;
40 bool vlock_end(void __attribute__((unused
)) **ctx_ptr
)
42 return unlock_console_switch();