1 /* vi: set sw=4 ts=4: */
3 * disalloc.c - aeb - 940501 - Disallocate virtual terminal(s)
10 #include <sys/ioctl.h>
13 /* From <linux/vt.h> */
14 static const int VT_DISALLOCATE = 0x5608; /* free memory associated to vt */
16 int deallocvt_main(int argc, char *argv[])
23 fd = get_console_fd();
25 /* num=0 deallocate all unused consoles */
29 num=bb_xgetlarg(argv[1], 10, 0, INT_MAX);
34 bb_error_msg("0: illegal VT number");
37 bb_error_msg("VT 1 cannot be deallocated");
41 if (ioctl(fd, VT_DISALLOCATE, num))
42 bb_perror_msg_and_die("VT_DISALLOCATE");