Last change
on this file since 2896 was 2725, checked in by Bruno Cornec, 14 years ago |
- Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
|
File size:
863 bytes
|
Rev | Line | |
---|
[821] | 1 | /* vi: set sw=4 ts=4: */
|
---|
| 2 | /*
|
---|
| 3 | * Disallocate virtual terminal(s)
|
---|
| 4 | *
|
---|
| 5 | * Copyright (C) 2003 by Tito Ragusa <farmatito@tiscali.it>
|
---|
| 6 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
|
---|
| 7 | *
|
---|
[2725] | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
---|
[821] | 9 | */
|
---|
| 10 |
|
---|
| 11 | /* no options, no getopt */
|
---|
| 12 |
|
---|
[1765] | 13 | #include "libbb.h"
|
---|
[821] | 14 |
|
---|
| 15 | /* From <linux/vt.h> */
|
---|
| 16 | enum { VT_DISALLOCATE = 0x5608 }; /* free memory associated to vt */
|
---|
| 17 |
|
---|
[2725] | 18 | int deallocvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
---|
| 19 | int deallocvt_main(int argc UNUSED_PARAM, char **argv)
|
---|
[821] | 20 | {
|
---|
| 21 | /* num = 0 deallocate all unused consoles */
|
---|
| 22 | int num = 0;
|
---|
| 23 |
|
---|
[2725] | 24 | if (argv[1]) {
|
---|
| 25 | if (argv[2])
|
---|
| 26 | bb_show_usage();
|
---|
[1765] | 27 | num = xatou_range(argv[1], 1, 63);
|
---|
[821] | 28 | }
|
---|
| 29 |
|
---|
[2725] | 30 | /* double cast suppresses "cast to ptr from int of different size" */
|
---|
| 31 | xioctl(get_console_fd_or_die(), VT_DISALLOCATE, (void *)(ptrdiff_t)num);
|
---|
[821] | 32 | return EXIT_SUCCESS;
|
---|
| 33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.