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 #ifndef BB_FEATURE_TRIVIAL_HELP
24 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
28 fd = get_console_fd("/dev/console");
30 if (ioctl(fd, VT_ACTIVATE, num)) {
31 perror("VT_ACTIVATE");
34 if (ioctl(fd, VT_WAITACTIVE, num)) {
35 perror("VT_WAITACTIVE");