From cd2663f15e74274619dd97dc382bb858ac255872 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 1 Jun 2008 22:36:39 +0000 Subject: ash: optional printf builtin. +25 bytes if off, +35 if on. by Cristian Ionescu-Idbohrn. --- include/applets.h | 2 +- include/libbb.h | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/applets.h b/include/applets.h index 17113dfe7..e7fc3c03c 100644 --- a/include/applets.h +++ b/include/applets.h @@ -275,7 +275,7 @@ USE_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_NEVER)) USE_PKILL(APPLET_ODDNAME(pkill, pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER, pkill)) USE_HALT(APPLET_ODDNAME(poweroff, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, poweroff)) USE_PRINTENV(APPLET(printenv, _BB_DIR_BIN, _BB_SUID_NEVER)) -USE_PRINTF(APPLET(printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_PRINTF(APPLET_NOFORK(printf, printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER, printf)) USE_PS(APPLET(ps, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_PSCAN(APPLET(pscan, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_PWD(APPLET_NOFORK(pwd, pwd, _BB_DIR_BIN, _BB_SUID_NEVER, pwd)) diff --git a/include/libbb.h b/include/libbb.h index 947f28d79..c79cd8b20 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -878,13 +878,16 @@ extern void bb_verror_msg(const char *s, va_list p, const char *strerr); #endif -/* applets which are useful from another applets */ +/* Applets which are useful from another applets */ int bb_cat(char** argv); -/* If shell needs them, these three "exist" even if not enabled as applets */ +/* If shell needs them, they exist even if not enabled as applets */ int echo_main(int argc, char** argv) USE_ECHO(MAIN_EXTERNALLY_VISIBLE); +int printf_main(int argc, char **argv) USE_PRINTF(MAIN_EXTERNALLY_VISIBLE); int test_main(int argc, char **argv) USE_TEST(MAIN_EXTERNALLY_VISIBLE); int kill_main(int argc, char **argv) USE_KILL(MAIN_EXTERNALLY_VISIBLE); -int chown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; +/* Similar, but used by chgrp, not shell */ +int chown_main(int argc, char **argv) USE_CHOWN(MAIN_EXTERNALLY_VISIBLE); +/* Don't need USE_xxx() guard for these */ int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int bbunpack(char **argv, -- cgit v1.2.3