summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vidcontrol/vidcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/vidcontrol/vidcontrol.c')
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index 3bc73d1..5f0d018 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -76,7 +76,7 @@ usage()
"usage: vidcontrol [-CdLPpx] [-b color] [-c appearance] [-f [size] file]",
" [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]",
" [-m on | off] [-M char] [-r foreground background] [-s num]",
-" [-t N | off] [mode] [foreground [background]] [show]");
+" [-S on | off] [-t N | off] [mode] [foreground [background]] [show]");
exit(1);
}
@@ -518,6 +518,23 @@ set_mouse(char *arg)
ioctl(0, CONS_MOUSECTL, &mouse);
}
+void
+set_lockswitch(char *arg)
+{
+ int data;
+
+ if (!strcmp(arg, "off"))
+ data = 0x01;
+ else if (!strcmp(arg, "on"))
+ data = 0x02;
+ else {
+ warnx("argument to -S must either on or off");
+ return;
+ }
+ if (ioctl(0, VT_LOCKSWITCH, &data) == -1)
+ warn("ioctl(VT_LOCKSWITCH)");
+}
+
static char
*adapter_name(int type)
{
@@ -749,7 +766,7 @@ main(int argc, char **argv)
/* Not reached */
if (ioctl(0, CONS_GETINFO, &info) < 0)
err(1, "must be on a virtual console");
- while((opt = getopt(argc, argv, "b:Cc:df:g:h:i:l:LM:m:pPr:s:t:x")) != -1)
+ while((opt = getopt(argc, argv, "b:Cc:df:g:h:i:l:LM:m:pPr:S:s:t:x")) != -1)
switch(opt) {
case 'b':
set_border_color(optarg);
@@ -806,6 +823,9 @@ main(int argc, char **argv)
case 'r':
set_reverse_colors(argc, argv, &optind);
break;
+ case 'S':
+ set_lockswitch(optarg);
+ break;
case 's':
set_console(optarg);
break;
OpenPOWER on IntegriCloud