1 /* vi: set sw=4 ts=4: */
3 * disalloc.c - aeb - 940501 - Disallocate virtual terminal(s)
10 #include <sys/ioctl.h>
16 int deallocvt_main(int argc, char *argv[])
20 if ((argc != 2) || (**(argv + 1) == '-')) {
22 ("deallocvt N\n\nDeallocate unused virtual terminal /dev/ttyN\n");
27 fd = get_console_fd("/dev/console");
30 /* deallocate all unused consoles */
31 if (ioctl(fd, VT_DISALLOCATE, 0)) {
32 perror("VT_DISALLOCATE");
36 for (i = 1; i < argc; i++) {
39 fprintf(stderr, "%s: 0: illegal VT number\n", progname);
41 fprintf(stderr, "%s: VT 1 cannot be deallocated\n",
43 else if (ioctl(fd, VT_DISALLOCATE, num)) {
44 perror("VT_DISALLOCATE");
45 fprintf(stderr, "%s: could not deallocate console %d\n",