aboutsummaryrefslogtreecommitdiff
path: root/chvt.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-10-24 05:00:29 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-10-24 05:00:29 +0000
commit1e2799601614452a40df7862e6ca180ecb08c04d (patch)
tree153a573095afac8d8d0ea857759ecabd77fb28b7 /chvt.c
parent47f91d1f7fc06cf27e2a6c3c2ada99226ba50cb9 (diff)
downloadbusybox-w32-1e2799601614452a40df7862e6ca180ecb08c04d.tar.gz
busybox-w32-1e2799601614452a40df7862e6ca180ecb08c04d.tar.bz2
busybox-w32-1e2799601614452a40df7862e6ca180ecb08c04d.zip
Major rework of the directory structure and the entire build system.
-Erik git-svn-id: svn://busybox.net/trunk/busybox@3561 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'chvt.c')
-rw-r--r--chvt.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/chvt.c b/chvt.c
deleted file mode 100644
index c76e9c780..000000000
--- a/chvt.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * chvt.c - aeb - 940227 - Change virtual terminal
4 *
5 * busyboxed by Erik Andersen
6 */
7
8/* getopt not needed */
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <fcntl.h>
13#include <sys/types.h>
14#include <sys/ioctl.h>
15#include "busybox.h"
16
17/* From <linux/vt.h> */
18static const int VT_ACTIVATE = 0x5606; /* make vt active */
19static const int VT_WAITACTIVE = 0x5607; /* wait for vt active */
20
21int chvt_main(int argc, char **argv)
22{
23 int fd, num;
24
25 if ((argc != 2) || (**(argv + 1) == '-'))
26 show_usage();
27 fd = get_console_fd("/dev/console");
28 num = atoi(argv[1]);
29 if (ioctl(fd, VT_ACTIVATE, num))
30 perror_msg_and_die("VT_ACTIVATE");
31 if (ioctl(fd, VT_WAITACTIVE, num))
32 perror_msg_and_die("VT_WAITACTIVE");
33 return EXIT_SUCCESS;
34}
35
36
37/*
38Local Variables:
39c-file-style: "linux"
40c-basic-offset: 4
41tab-width: 4
42End:
43*/