1 /* vi: set sw=4 ts=4: */
3 * chvt.c - aeb - 940227 - Change virtual terminal
5 * busyboxed by Erik Andersen
15 int chvt_main(int argc, char **argv)
19 if ((argc != 2) || (**(argv + 1) == '-')) {
21 #ifndef BB_FEATURE_TRIVIAL_HELP
22 "\nChanges the foreground virtual terminal to /dev/ttyN\n"
26 fd = get_console_fd("/dev/console");
28 if (ioctl(fd, VT_ACTIVATE, num)) {
29 perror("VT_ACTIVATE");
32 if (ioctl(fd, VT_WAITACTIVE, num)) {
33 perror("VT_WAITACTIVE");