1 /* vi: set sw=4 ts=4: */
3 * Disallocate virtual terminal(s)
5 * Copyright (C) 2003 by Tito Ragusa <farmatito@tiscali.it>
6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
11 /* no options, no getopt */
15 /* From <linux/vt.h> */
16 enum { VT_DISALLOCATE = 0x5608 }; /* free memory associated to vt */
18 int deallocvt_main(int argc, char *argv[])
20 /* num = 0 deallocate all unused consoles */
25 num = xatoul_range(argv[1], 1, 63);
33 if (-1 == ioctl(get_console_fd(), VT_DISALLOCATE, num)) {
34 bb_perror_msg_and_die("VT_DISALLOCATE");