2000-02-09 01:28:47 +05:30
|
|
|
/* vi: set sw=4 ts=4: */
|
1999-10-26 05:02:44 +05:30
|
|
|
/*
|
2003-10-22 16:00:53 +05:30
|
|
|
* Mini chvt implementation for busybox
|
1999-10-26 05:02:44 +05:30
|
|
|
*
|
2004-03-15 13:59:22 +05:30
|
|
|
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
|
2003-10-22 16:00:53 +05:30
|
|
|
*
|
2010-08-16 23:44:46 +05:30
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
1999-10-26 05:02:44 +05:30
|
|
|
*/
|
2016-11-23 15:09:27 +05:30
|
|
|
//config:config CHVT
|
2017-07-19 01:31:24 +05:30
|
|
|
//config: bool "chvt (2 kb)"
|
2016-11-23 15:09:27 +05:30
|
|
|
//config: default y
|
|
|
|
//config: select PLATFORM_LINUX
|
|
|
|
//config: help
|
2017-07-21 13:20:55 +05:30
|
|
|
//config: This program is used to change to another terminal.
|
|
|
|
//config: Example: chvt 4 (change to terminal /dev/tty4)
|
2016-11-23 15:09:27 +05:30
|
|
|
|
2017-08-05 05:32:31 +05:30
|
|
|
//applet:IF_CHVT(APPLET_NOEXEC(chvt, chvt, BB_DIR_USR_BIN, BB_SUID_DROP, chvt))
|
2016-11-23 15:09:27 +05:30
|
|
|
|
|
|
|
//kbuild:lib-$(CONFIG_CHVT) += chvt.o
|
2011-03-28 03:12:28 +05:30
|
|
|
|
|
|
|
//usage:#define chvt_trivial_usage
|
|
|
|
//usage: "N"
|
|
|
|
//usage:#define chvt_full_usage "\n\n"
|
|
|
|
//usage: "Change the foreground virtual terminal to /dev/ttyN"
|
|
|
|
|
2007-05-27 00:30:18 +05:30
|
|
|
#include "libbb.h"
|
2000-07-09 00:25:24 +05:30
|
|
|
|
2007-10-11 15:35:36 +05:30
|
|
|
int chvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
2009-11-28 19:48:53 +05:30
|
|
|
int chvt_main(int argc UNUSED_PARAM, char **argv)
|
1999-10-26 05:02:44 +05:30
|
|
|
{
|
2009-11-28 19:48:53 +05:30
|
|
|
int num = xatou_range(single_argv(argv), 1, 63);
|
2008-08-06 05:02:27 +05:30
|
|
|
console_make_active(get_console_fd_or_die(), num);
|
2000-12-01 08:25:13 +05:30
|
|
|
return EXIT_SUCCESS;
|
1999-10-26 05:02:44 +05:30
|
|
|
}
|