aboutsummaryrefslogtreecommitdiff
path: root/console-tools/openvt.c
AgeCommit message (Collapse)Author
2020-08-13build system: drop PLATFORM_LINUXRon Yorston
PLATFORM_LINUX is a hidden configuration option which is disabled by default and enabled at over a hundred locations for features that are deemed to be Linux specific. The only effect of PLATFORM_LINUX is to control compilation of libbb/match_fstype.c. This file is only needed by mount and umount. Remove all references to PLATFORM_LINUX and compile match_fstype.c if mount or umount is enabled. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-07-02libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2018-12-28config: update size informationDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-08-04libbb: use _exit, not exit, in bb_daemonize_or_rexec()Denys Vlasenko
By the time we reach exit in parent, child already exited or execed. We should not re-run libc cleanup code. While at it, introduce bb_daemon_helper() and add a few comments. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-21config: deindent all help textsDenys Vlasenko
Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-18Update menuconfig items with approximate applet sizesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-23Convert all console-tools/* applets to "new style" applet definitionsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05*: remove "Options:" string from help textsDenys Vlasenko
function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-28move help text from include/usage.src.h to console-tools/*.cPere Orga
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-08use user's shell instead of hardwired "/bin/sh" (android needs this)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-16*: make GNU licensing statement forms more regularDenys Vlasenko
This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-04libbb: introduce and use BB_EXECVP_or_die()Pascal Bellard
function old new delta BB_EXECVP_or_die - 47 +47 time_main 1042 1043 +1 chrt_main 371 364 -7 ionice_main 292 282 -10 setsid_main 69 56 -13 nohup_main 236 223 -13 cttyhack_main 266 253 -13 chroot_main 94 81 -13 chpst_main 746 733 -13 timeout_main 297 279 -18 taskset_main 541 522 -19 vfork_child 67 45 -22 parse 975 953 -22 lpd_main 770 748 -22 launch_helper 192 170 -22 tcpudpsvd_main 1810 1782 -28 nice_main 190 156 -34 env_main 242 206 -36 run_command 221 174 -47 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/17 up/down: 48/-352) Total: -304 bytes Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-25*: make exec failure message more consistentDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-11tidy up O_NONBLOCK usage. use libbb functions in stty.Denys Vlasenko
Added O_RDONLY where improves readability. Note: O_RDONLY == 0, so it is there even if not specified. function old new delta stty_main 1289 1235 -54 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2008-07-05*: rename ATTRIBUTE_XXX to just XXX.Denis Vlasenko
2008-05-19- Rename getpty() to xgetpty() and adjust callers.Bernhard Reutner-Fischer
- Rewrite kbd_mode and setconsole - Introduce and use console_make_active() and xopen_xwrite_close() - honour buffer-reservation method as set by the user (dumpkmap, loadkmap) - shrink rtcwake and some console-tools Saves about 270 Bytes
2008-04-22whitespace fixes. no code changesDenis Vlasenko
2008-04-19openvt: handle -ws correctly. By James Simmons <jsimmons AT infradead.org>Denis Vlasenko
function old new delta openvt_main 343 429 +86
2008-03-27openvt: fix gross mismatch between us and "standard" openvt.Denis Vlasenko
standard one even has different syntax! std: "openvt -c 12", we: "openvt 12" std: "openvt top", we: complain that "top" is not a number. openvt: implement -c -w -s (-l -f -v are also accepted but ingnored) openvt_main 188 343 +155 vfork_child - 67 +67 not_vt_fd - 23 +23 packed_usage 23932 23952 +20 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/0 up/down: 265/0) Total: 265 bytes text data bss dec hex filename 801344 641 7380 809365 c5995 busybox_old 801617 641 7380 809638 c5aa6 busybox_unstripped
2008-03-17*: shrink: use Vladimir's "o+" specifier instead of xatou(opt_param)Denis Vlasenko
function old new delta getopt32 1370 1385 +15 sulogin_main 490 494 +4 realpath_main 84 86 +2 sleep_main 76 77 +1 mt_main 256 257 +1 printenv_main 75 74 -1 fdformat_main 546 545 -1 usleep_main 44 42 -2 setlogcons_main 77 75 -2 ed_main 2654 2649 -5 deallocvt_main 69 64 -5 addgroup_main 373 368 -5 mkfs_minix_main 2989 2982 -7 tail_main 1221 1213 -8 sv_main 1254 1241 -13 du_main 348 328 -20 tftp_main 325 302 -23 split_main 581 558 -23 nc_main 1000 977 -23 diff_main 891 868 -23 arping_main 1797 1770 -27 ls_main 893 847 -46 od_main 2797 2750 -47 readprofile_main 1944 1895 -49 tcpudpsvd_main 1973 1922 -51 udhcpc_main 2590 2513 -77 grep_main 824 722 -102 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/22 up/down: 23/-560) Total: -537 bytes text data bss dec hex filename 796973 658 7428 805059 c48c3 busybox_old 796479 662 7420 804561 c46d1 busybox_unstripped
2007-10-11add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-05-26usage.c: remove reference to busybox.hDenis Vlasenko
*: s/include "busybox.h"/include "libbb.h"
2007-03-26Attempt to get more applets compile for NOMMU.Denis Vlasenko
TODO_config_nommu documents what I managed to compile so far (yay! msh works! cool). inetd, telnetd, httpd still do not compile. TODO Also make fork(), daemon() produce warnings on compile stage (in addition to erros on link stage).
2007-03-25add NOMMU fixme's; move move_fd from runit_lib to libbb; nuke fd_copyDenis Vlasenko
2007-02-06EXEC_PREFER_APPLETS support by Gabriel L. Somlo <somlo@cmu.edu>Denis Vlasenko
2007-02-03suppress warnings about easch <applet>_main() havingDenis Vlasenko
no preceding prototype
2007-01-19openvt,getty,vfork_daemon_rexec,mount: tighten up fd cleanup codeDenis Vlasenko
(will close all fd's > 2 on daemonization now) getty: fix "getty -" support, and also do not try to chown/chmod "-" telnetd: fix "lost ctty" bug Yet another attempt on saner function names: bb_sanitize_server_stdio(0/1) -> bb_sanitize_stdio() + bb_daemonize();
2006-10-08attempt to regularize atoi mess.Denis Vlasenko
2006-08-03Remove bb_ prefixes from xfuncs.c (and a few other places), consolidateRob Landley
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
2006-05-19- remove emacs layout block as suggested by Robert P.J. DayBernhard Reutner-Fischer
- use shorter boilerplate while at it
2006-03-10Cleanup patches from tito.Rob Landley
2006-01-25just whitespaceTim Riker
2005-09-08Tito sent more size tweaks.Rob Landley
2004-03-15Remove trailing whitespace. Update copyright to include 2004.Eric Andersen
2004-01-13Patch by Tito, remove some unneeded variables to save some space.Glenn L McGrath
2003-12-20Use bb_xopenGlenn L McGrath
2003-05-13Re-use existing variables, patch from TitoGlenn L McGrath
2003-03-19Major coreutils update.Manuel Novoa III
2002-12-08Fix compile warningGlenn L McGrath
2002-09-16Put in GPL v2 or later copyright noticeGlenn L McGrath
2002-09-16openvt applet by Quy TonthatGlenn L McGrath