2 * disalloc.c - aeb - 940501 - Disallocate virtual terminal(s)
13 extern int getfd(void);
17 deallocvt_main(int argc, char *argv[]) {
20 if ( ( argc != 2) || (**(argv+1) == '-' ) ) {
21 usage ("deallocvt N\n\nDeallocate unused virtual terminal /dev/ttyN\n");
26 fd = get_console_fd("/dev/console");
29 /* deallocate all unused consoles */
30 if (ioctl(fd,VT_DISALLOCATE,0)) {
31 perror("VT_DISALLOCATE");
35 for (i = 1; i < argc; i++) {
38 fprintf(stderr, "%s: 0: illegal VT number\n", progname);
40 fprintf(stderr, "%s: VT 1 cannot be deallocated\n", progname);
42 if (ioctl(fd,VT_DISALLOCATE,num)) {
43 perror("VT_DISALLOCATE");
44 fprintf(stderr, "%s: could not deallocate console %d\n",