1 /* ttyblank.c -- a console blanking 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
16 #include <sys/ioctl.h>
17 #include <linux/tiocl.h>
19 #include "vlock_plugin.h"
21 const char *depends
[] = { "all", NULL
};
23 bool vlock_save(void __attribute__ ((__unused__
)) ** ctx
)
25 char arg
[] = { TIOCL_BLANKSCREEN
, 0 };
26 return ioctl(STDIN_FILENO
, TIOCLINUX
, arg
) == 0;
29 bool vlock_save_abort(void __attribute__ ((__unused__
)) ** ctx
)
31 char arg
[] = { TIOCL_UNBLANKSCREEN
, 0 };
32 return ioctl(STDIN_FILENO
, TIOCLINUX
, arg
) == 0;