2 * chvt.c - aeb - 940227 - Change virtual terminal
4 * busyboxed by Erik Andersen
14 extern int getfd(void);
17 chvt_main(int argc, char** argv)
21 if ( ( argc != 2) || (**(argv+1) == '-' ) ) {
22 usage ("chvt N\n\nChange foreground virtual terminal to /dev/ttyN\n");
24 fd = get_console_fd("/dev/console");
26 if (ioctl(fd,VT_ACTIVATE,num)) {
27 perror("VT_ACTIVATE");
30 if (ioctl(fd,VT_WAITACTIVE,num)) {
31 perror("VT_WAITACTIVE");