1 /* vi: set sw=4 ts=4: */
3 * chvt.c - aeb - 940227 - Change virtual terminal
5 * busyboxed by Erik Andersen
15 extern int getfd(void);
17 int chvt_main(int argc, char **argv)
21 if ((argc != 2) || (**(argv + 1) == '-')) {
23 ("chvt N\n\nChange foreground virtual terminal to /dev/ttyN\n");
25 fd = get_console_fd("/dev/console");
27 if (ioctl(fd, VT_ACTIVATE, num)) {
28 perror("VT_ACTIVATE");
31 if (ioctl(fd, VT_WAITACTIVE, num)) {
32 perror("VT_WAITACTIVE");