1 /* vlock-lockswitch.c -- console switch locking routine 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
16 #include <sys/types.h>
19 #include <sys/ioctl.h>
27 if ((consfd
= open(CONSOLE
, O_RDWR
)) < 0) {
28 perror("vlock-lockswitch: cannot open virtual console");
32 /* globally disable virtual console switching */
33 if (ioctl(consfd
, VT_LOCKSWITCH
) < 0) {
34 perror("vlock-lockswitch: could not disable console switching");