aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c8
-rw-r--r--libbb/ask_confirmation.c2
-rw-r--r--libbb/bb_askpass.c2
-rw-r--r--libbb/bb_basename.c2
-rw-r--r--libbb/bb_do_delay.c2
-rw-r--r--libbb/bb_pwd.c12
-rw-r--r--libbb/bb_qsort.c4
-rw-r--r--libbb/bb_strtonum.c14
-rw-r--r--libbb/change_identity.c2
-rw-r--r--libbb/chomp.c2
-rw-r--r--libbb/compare_string_array.c10
-rw-r--r--libbb/concat_path_file.c2
-rw-r--r--libbb/concat_subpath_file.c2
-rw-r--r--libbb/copy_file.c2
-rw-r--r--libbb/copyfd.c8
-rw-r--r--libbb/correct_password.c2
-rw-r--r--libbb/crc32.c2
-rw-r--r--libbb/create_icmp6_socket.c2
-rw-r--r--libbb/create_icmp_socket.c2
-rw-r--r--libbb/crypt_make_salt.c2
-rw-r--r--libbb/device_open.c2
-rw-r--r--libbb/die_if_bad_username.c2
-rw-r--r--libbb/dump.c6
-rw-r--r--libbb/error_msg.c2
-rw-r--r--libbb/error_msg_and_die.c2
-rw-r--r--libbb/execable.c8
-rw-r--r--libbb/fclose_nonstdin.c2
-rw-r--r--libbb/fflush_stdout_and_exit.c2
-rw-r--r--libbb/fgets_str.c4
-rw-r--r--libbb/find_mount_point.c2
-rw-r--r--libbb/find_pid_by_name.c4
-rw-r--r--libbb/find_root_device.c2
-rw-r--r--libbb/full_write.c2
-rw-r--r--libbb/get_console.c4
-rw-r--r--libbb/get_last_path_component.c4
-rw-r--r--libbb/get_line_from_file.c6
-rw-r--r--libbb/getopt32.c2
-rw-r--r--libbb/getpty.c2
-rw-r--r--libbb/herror_msg.c2
-rw-r--r--libbb/herror_msg_and_die.c2
-rw-r--r--libbb/human_readable.c2
-rw-r--r--libbb/inet_common.c8
-rw-r--r--libbb/info_msg.c2
-rw-r--r--libbb/inode_hash.c6
-rw-r--r--libbb/isdirectory.c2
-rw-r--r--libbb/kernel_version.c2
-rw-r--r--libbb/last_char_is.c2
-rw-r--r--libbb/lineedit.c6
-rw-r--r--libbb/llist.c12
-rw-r--r--libbb/login.c6
-rw-r--r--libbb/loop.c6
-rw-r--r--libbb/make_directory.c2
-rw-r--r--libbb/match_fstype.c2
-rw-r--r--libbb/md5.c6
-rw-r--r--libbb/mode_string.c4
-rw-r--r--libbb/mtab.c2
-rw-r--r--libbb/obscure.c2
-rw-r--r--libbb/parse_mode.c2
-rw-r--r--libbb/perror_msg.c4
-rw-r--r--libbb/perror_msg_and_die.c4
-rw-r--r--libbb/perror_nomsg.c7
-rw-r--r--libbb/perror_nomsg_and_die.c7
-rw-r--r--libbb/pidfile.c2
-rw-r--r--libbb/print_flags.c6
-rw-r--r--libbb/printable.c2
-rw-r--r--libbb/process_escape_sequence.c2
-rw-r--r--libbb/procps.c18
-rw-r--r--libbb/pw_encrypt.c4
-rw-r--r--libbb/read.c24
-rw-r--r--libbb/recursive_action.c8
-rw-r--r--libbb/remove_file.c2
-rw-r--r--libbb/restricted_shell.c2
-rw-r--r--libbb/rtc.c6
-rw-r--r--libbb/run_shell.c8
-rw-r--r--libbb/safe_gethostname.c2
-rw-r--r--libbb/safe_poll.c2
-rw-r--r--libbb/safe_strncpy.c2
-rw-r--r--libbb/safe_write.c2
-rw-r--r--libbb/selinux_common.c6
-rw-r--r--libbb/setup_environment.c2
-rw-r--r--libbb/sha1.c6
-rw-r--r--libbb/signals.c20
-rw-r--r--libbb/simplify_path.c2
-rw-r--r--libbb/skip_whitespace.c4
-rw-r--r--libbb/speed_table.c4
-rw-r--r--libbb/str_tolower.c3
-rw-r--r--libbb/strrstr.c2
-rw-r--r--libbb/time.c8
-rw-r--r--libbb/trim.c2
-rw-r--r--libbb/u_signal_names.c6
-rw-r--r--libbb/udp_io.c6
-rw-r--r--libbb/update_passwd.c2
-rw-r--r--libbb/uuencode.c2
-rw-r--r--libbb/vdprintf.c2
-rw-r--r--libbb/verror_msg.c4
-rw-r--r--libbb/vfork_daemon_rexec.c30
-rw-r--r--libbb/warn_ignoring_args.c2
-rw-r--r--libbb/wfopen.c2
-rw-r--r--libbb/wfopen_input.c6
-rw-r--r--libbb/write.c2
-rw-r--r--libbb/xatonum.c4
-rw-r--r--libbb/xatonum_template.c28
-rw-r--r--libbb/xconnect.c50
-rw-r--r--libbb/xfunc_die.c2
-rw-r--r--libbb/xfuncs.c24
-rw-r--r--libbb/xfuncs_printf.c96
-rw-r--r--libbb/xgetcwd.c2
-rw-r--r--libbb/xgethostbyname.c2
-rw-r--r--libbb/xreadlink.c8
-rw-r--r--libbb/xregcomp.c4
110 files changed, 339 insertions, 338 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 06a83e58d..0017a4bef 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -101,7 +101,7 @@ static void full_write2_str(const char *str)
101 full_write(STDERR_FILENO, str, strlen(str)); 101 full_write(STDERR_FILENO, str, strlen(str));
102} 102}
103 103
104void bb_show_usage(void) 104void FAST_FUNC bb_show_usage(void)
105{ 105{
106 if (ENABLE_SHOW_USAGE) { 106 if (ENABLE_SHOW_USAGE) {
107#ifdef SINGLE_APPLET_STR 107#ifdef SINGLE_APPLET_STR
@@ -153,7 +153,7 @@ static int applet_name_compare(const void *name, const void *v)
153 return strcmp(name, APPLET_NAME(i)); 153 return strcmp(name, APPLET_NAME(i));
154} 154}
155#endif 155#endif
156int find_applet_by_name(const char *name) 156int FAST_FUNC find_applet_by_name(const char *name)
157{ 157{
158#if NUM_APPLETS > 8 158#if NUM_APPLETS > 8
159 /* Do a binary search to find the applet entry given the name. */ 159 /* Do a binary search to find the applet entry given the name. */
@@ -704,7 +704,7 @@ static int busybox_main(char **argv)
704 xfunc_die(); 704 xfunc_die();
705} 705}
706 706
707void run_applet_no_and_exit(int applet_no, char **argv) 707void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
708{ 708{
709 int argc = 1; 709 int argc = 1;
710 710
@@ -722,7 +722,7 @@ void run_applet_no_and_exit(int applet_no, char **argv)
722 exit(applet_main[applet_no](argc, argv)); 722 exit(applet_main[applet_no](argc, argv));
723} 723}
724 724
725void run_applet_and_exit(const char *name, char **argv) 725void FAST_FUNC run_applet_and_exit(const char *name, char **argv)
726{ 726{
727 int applet = find_applet_by_name(name); 727 int applet = find_applet_by_name(name);
728 if (applet >= 0) 728 if (applet >= 0)
diff --git a/libbb/ask_confirmation.c b/libbb/ask_confirmation.c
index 646ec4b7e..d08bc515e 100644
--- a/libbb/ask_confirmation.c
+++ b/libbb/ask_confirmation.c
@@ -13,7 +13,7 @@
13 13
14#include "libbb.h" 14#include "libbb.h"
15 15
16int bb_ask_confirmation(void) 16int FAST_FUNC bb_ask_confirmation(void)
17{ 17{
18 int retval = 0; 18 int retval = 0;
19 int first = 1; 19 int first = 1;
diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c
index 3ad0e97cd..ca18aded9 100644
--- a/libbb/bb_askpass.c
+++ b/libbb/bb_askpass.c
@@ -17,7 +17,7 @@ static void askpass_timeout(int ATTRIBUTE_UNUSED ignore)
17{ 17{
18} 18}
19 19
20char *bb_askpass(int timeout, const char *prompt) 20char* FAST_FUNC bb_askpass(int timeout, const char *prompt)
21{ 21{
22 /* Was static char[BIGNUM] */ 22 /* Was static char[BIGNUM] */
23 enum { sizeof_passwd = 128 }; 23 enum { sizeof_passwd = 128 };
diff --git a/libbb/bb_basename.c b/libbb/bb_basename.c
index e6832f8ef..bab4166d6 100644
--- a/libbb/bb_basename.c
+++ b/libbb/bb_basename.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12const char *bb_basename(const char *name) 12const char* FAST_FUNC bb_basename(const char *name)
13{ 13{
14 const char *cp = strrchr(name, '/'); 14 const char *cp = strrchr(name, '/');
15 if (cp) 15 if (cp)
diff --git a/libbb/bb_do_delay.c b/libbb/bb_do_delay.c
index aa26aded1..3d52cc562 100644
--- a/libbb/bb_do_delay.c
+++ b/libbb/bb_do_delay.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void bb_do_delay(int seconds) 12void FAST_FUNC bb_do_delay(int seconds)
13{ 13{
14 time_t start, now; 14 time_t start, now;
15 15
diff --git a/libbb/bb_pwd.c b/libbb/bb_pwd.c
index 2bdb66230..b03dc8399 100644
--- a/libbb/bb_pwd.c
+++ b/libbb/bb_pwd.c
@@ -45,7 +45,7 @@ static char* bb_getug(char *buffer, int bufsize, char *idname, long id, char pre
45 * bb_getXXXid(NULL, -1, id) - return user/group name or exit 45 * bb_getXXXid(NULL, -1, id) - return user/group name or exit
46 */ 46 */
47/* gets a username given a uid */ 47/* gets a username given a uid */
48char* bb_getpwuid(char *name, int bufsize, long uid) 48char* FAST_FUNC bb_getpwuid(char *name, int bufsize, long uid)
49{ 49{
50 struct passwd *myuser = getpwuid(uid); 50 struct passwd *myuser = getpwuid(uid);
51 51
@@ -54,7 +54,7 @@ char* bb_getpwuid(char *name, int bufsize, long uid)
54 uid, 'u'); 54 uid, 'u');
55} 55}
56/* gets a groupname given a gid */ 56/* gets a groupname given a gid */
57char* bb_getgrgid(char *group, int bufsize, long gid) 57char* FAST_FUNC bb_getgrgid(char *group, int bufsize, long gid)
58{ 58{
59 struct group *mygroup = getgrgid(gid); 59 struct group *mygroup = getgrgid(gid);
60 60
@@ -64,7 +64,7 @@ char* bb_getgrgid(char *group, int bufsize, long gid)
64} 64}
65 65
66/* returns a gid given a group name */ 66/* returns a gid given a group name */
67long xgroup2gid(const char *name) 67long FAST_FUNC xgroup2gid(const char *name)
68{ 68{
69 struct group *mygroup; 69 struct group *mygroup;
70 70
@@ -76,7 +76,7 @@ long xgroup2gid(const char *name)
76} 76}
77 77
78/* returns a uid given a username */ 78/* returns a uid given a username */
79long xuname2uid(const char *name) 79long FAST_FUNC xuname2uid(const char *name)
80{ 80{
81 struct passwd *myuser; 81 struct passwd *myuser;
82 82
@@ -87,8 +87,8 @@ long xuname2uid(const char *name)
87 return myuser->pw_uid; 87 return myuser->pw_uid;
88} 88}
89 89
90unsigned long get_ug_id(const char *s, 90unsigned long FAST_FUNC get_ug_id(const char *s,
91 long (*xname2id)(const char *)) 91 long FAST_FUNC (*xname2id)(const char *))
92{ 92{
93 unsigned long r; 93 unsigned long r;
94 94
diff --git a/libbb/bb_qsort.c b/libbb/bb_qsort.c
index e8673abf9..9773afa6e 100644
--- a/libbb/bb_qsort.c
+++ b/libbb/bb_qsort.c
@@ -9,12 +9,12 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12int bb_pstrcmp(const void *a, const void *b) 12int /* not FAST_FUNC! */ bb_pstrcmp(const void *a, const void *b)
13{ 13{
14 return strcmp(*(char**)a, *(char**)b); 14 return strcmp(*(char**)a, *(char**)b);
15} 15}
16 16
17void qsort_string_vector(char **sv, unsigned count) 17void FAST_FUNC qsort_string_vector(char **sv, unsigned count)
18{ 18{
19 qsort(sv, count, sizeof(char*), bb_pstrcmp); 19 qsort(sv, count, sizeof(char*), bb_pstrcmp);
20} 20}
diff --git a/libbb/bb_strtonum.c b/libbb/bb_strtonum.c
index 50ef0ba26..525c830cd 100644
--- a/libbb/bb_strtonum.c
+++ b/libbb/bb_strtonum.c
@@ -48,7 +48,7 @@ static unsigned long long handle_errors(unsigned long long v, char **endp, char
48} 48}
49 49
50 50
51unsigned long long bb_strtoull(const char *arg, char **endp, int base) 51unsigned long long FAST_FUNC bb_strtoull(const char *arg, char **endp, int base)
52{ 52{
53 unsigned long long v; 53 unsigned long long v;
54 char *endptr; 54 char *endptr;
@@ -63,7 +63,7 @@ unsigned long long bb_strtoull(const char *arg, char **endp, int base)
63 return handle_errors(v, endp, endptr); 63 return handle_errors(v, endp, endptr);
64} 64}
65 65
66long long bb_strtoll(const char *arg, char **endp, int base) 66long long FAST_FUNC bb_strtoll(const char *arg, char **endp, int base)
67{ 67{
68 unsigned long long v; 68 unsigned long long v;
69 char *endptr; 69 char *endptr;
@@ -75,7 +75,7 @@ long long bb_strtoll(const char *arg, char **endp, int base)
75} 75}
76 76
77#if ULONG_MAX != ULLONG_MAX 77#if ULONG_MAX != ULLONG_MAX
78unsigned long bb_strtoul(const char *arg, char **endp, int base) 78unsigned long FAST_FUNC bb_strtoul(const char *arg, char **endp, int base)
79{ 79{
80 unsigned long v; 80 unsigned long v;
81 char *endptr; 81 char *endptr;
@@ -86,7 +86,7 @@ unsigned long bb_strtoul(const char *arg, char **endp, int base)
86 return handle_errors(v, endp, endptr); 86 return handle_errors(v, endp, endptr);
87} 87}
88 88
89long bb_strtol(const char *arg, char **endp, int base) 89long FAST_FUNC bb_strtol(const char *arg, char **endp, int base)
90{ 90{
91 long v; 91 long v;
92 char *endptr; 92 char *endptr;
@@ -99,7 +99,7 @@ long bb_strtol(const char *arg, char **endp, int base)
99#endif 99#endif
100 100
101#if UINT_MAX != ULONG_MAX 101#if UINT_MAX != ULONG_MAX
102unsigned bb_strtou(const char *arg, char **endp, int base) 102unsigned FAST_FUNC bb_strtou(const char *arg, char **endp, int base)
103{ 103{
104 unsigned long v; 104 unsigned long v;
105 char *endptr; 105 char *endptr;
@@ -111,7 +111,7 @@ unsigned bb_strtou(const char *arg, char **endp, int base)
111 return handle_errors(v, endp, endptr); 111 return handle_errors(v, endp, endptr);
112} 112}
113 113
114int bb_strtoi(const char *arg, char **endp, int base) 114int FAST_FUNC bb_strtoi(const char *arg, char **endp, int base)
115{ 115{
116 long v; 116 long v;
117 char *endptr; 117 char *endptr;
@@ -131,7 +131,7 @@ int bb_strtoi(const char *arg, char **endp, int base)
131 131
132#include <math.h> /* just for HUGE_VAL */ 132#include <math.h> /* just for HUGE_VAL */
133#define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9) 133#define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9)
134double bb_strtod(const char *arg, char **endp) 134double FAST_FUNC bb_strtod(const char *arg, char **endp)
135{ 135{
136 double v; 136 double v;
137 char *endptr; 137 char *endptr;
diff --git a/libbb/change_identity.c b/libbb/change_identity.c
index da840bfb3..619db09a8 100644
--- a/libbb/change_identity.c
+++ b/libbb/change_identity.c
@@ -31,7 +31,7 @@
31#include "libbb.h" 31#include "libbb.h"
32 32
33/* Become the user and group(s) specified by PW. */ 33/* Become the user and group(s) specified by PW. */
34void change_identity(const struct passwd *pw) 34void FAST_FUNC change_identity(const struct passwd *pw)
35{ 35{
36 if (initgroups(pw->pw_name, pw->pw_gid) == -1) 36 if (initgroups(pw->pw_name, pw->pw_gid) == -1)
37 bb_perror_msg_and_die("can't set groups"); 37 bb_perror_msg_and_die("can't set groups");
diff --git a/libbb/chomp.c b/libbb/chomp.c
index 8ffaff518..ed4bf6beb 100644
--- a/libbb/chomp.c
+++ b/libbb/chomp.c
@@ -10,7 +10,7 @@
10 10
11#include "libbb.h" 11#include "libbb.h"
12 12
13void chomp(char *s) 13void FAST_FUNC chomp(char *s)
14{ 14{
15 char *lc = last_char_is(s, '\n'); 15 char *lc = last_char_is(s, '\n');
16 16
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c
index ec7f94e79..43c59e8e0 100644
--- a/libbb/compare_string_array.c
+++ b/libbb/compare_string_array.c
@@ -7,7 +7,7 @@
7 7
8/* returns the array index of the string */ 8/* returns the array index of the string */
9/* (index of first match is returned, or -1) */ 9/* (index of first match is returned, or -1) */
10int index_in_str_array(const char *const string_array[], const char *key) 10int FAST_FUNC index_in_str_array(const char *const string_array[], const char *key)
11{ 11{
12 int i; 12 int i;
13 13
@@ -19,7 +19,7 @@ int index_in_str_array(const char *const string_array[], const char *key)
19 return -1; 19 return -1;
20} 20}
21 21
22int index_in_strings(const char *strings, const char *key) 22int FAST_FUNC index_in_strings(const char *strings, const char *key)
23{ 23{
24 int idx = 0; 24 int idx = 0;
25 25
@@ -36,7 +36,7 @@ int index_in_strings(const char *strings, const char *key)
36/* returns the array index of the string, even if it matches only a beginning */ 36/* returns the array index of the string, even if it matches only a beginning */
37/* (index of first match is returned, or -1) */ 37/* (index of first match is returned, or -1) */
38#ifdef UNUSED 38#ifdef UNUSED
39int index_in_substr_array(const char *const string_array[], const char *key) 39int FAST_FUNC index_in_substr_array(const char *const string_array[], const char *key)
40{ 40{
41 int i; 41 int i;
42 int len = strlen(key); 42 int len = strlen(key);
@@ -51,7 +51,7 @@ int index_in_substr_array(const char *const string_array[], const char *key)
51} 51}
52#endif 52#endif
53 53
54int index_in_substrings(const char *strings, const char *key) 54int FAST_FUNC index_in_substrings(const char *strings, const char *key)
55{ 55{
56 int len = strlen(key); 56 int len = strlen(key);
57 57
@@ -68,7 +68,7 @@ int index_in_substrings(const char *strings, const char *key)
68 return -1; 68 return -1;
69} 69}
70 70
71const char *nth_string(const char *strings, int n) 71const char* FAST_FUNC nth_string(const char *strings, int n)
72{ 72{
73 while (n) { 73 while (n) {
74 n--; 74 n--;
diff --git a/libbb/concat_path_file.c b/libbb/concat_path_file.c
index dd6909fc2..fb533547e 100644
--- a/libbb/concat_path_file.c
+++ b/libbb/concat_path_file.c
@@ -16,7 +16,7 @@
16 16
17#include "libbb.h" 17#include "libbb.h"
18 18
19char *concat_path_file(const char *path, const char *filename) 19char* FAST_FUNC concat_path_file(const char *path, const char *filename)
20{ 20{
21 char *lc; 21 char *lc;
22 22
diff --git a/libbb/concat_subpath_file.c b/libbb/concat_subpath_file.c
index 1c0058889..313fa63cf 100644
--- a/libbb/concat_subpath_file.c
+++ b/libbb/concat_subpath_file.c
@@ -15,7 +15,7 @@
15 15
16#include "libbb.h" 16#include "libbb.h"
17 17
18char *concat_subpath_file(const char *path, const char *f) 18char* FAST_FUNC concat_subpath_file(const char *path, const char *f)
19{ 19{
20 if (f && DOT_OR_DOTDOT(f)) 20 if (f && DOT_OR_DOTDOT(f))
21 return NULL; 21 return NULL;
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index 3b83e1216..d804eccfa 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -71,7 +71,7 @@ static int ask_and_unlink(const char *dest, int flags)
71 * 0 copy is made or user answered "no" in interactive mode 71 * 0 copy is made or user answered "no" in interactive mode
72 * (failures to preserve mode/owner/times are not reported in exit code) 72 * (failures to preserve mode/owner/times are not reported in exit code)
73 */ 73 */
74int copy_file(const char *source, const char *dest, int flags) 74int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
75{ 75{
76 /* This is a recursive function, try to minimize stack usage */ 76 /* This is a recursive function, try to minimize stack usage */
77 /* NB: each struct stat is ~100 bytes */ 77 /* NB: each struct stat is ~100 bytes */
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 08bc6f8df..c5f8b5b87 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -85,7 +85,7 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
85 85
86 86
87#if 0 87#if 0
88void complain_copyfd_and_die(off_t sz) 88void FAST_FUNC complain_copyfd_and_die(off_t sz)
89{ 89{
90 if (sz != -1) 90 if (sz != -1)
91 bb_error_msg_and_die("short read"); 91 bb_error_msg_and_die("short read");
@@ -94,7 +94,7 @@ void complain_copyfd_and_die(off_t sz)
94} 94}
95#endif 95#endif
96 96
97off_t bb_copyfd_size(int fd1, int fd2, off_t size) 97off_t FAST_FUNC bb_copyfd_size(int fd1, int fd2, off_t size)
98{ 98{
99 if (size) { 99 if (size) {
100 return bb_full_fd_action(fd1, fd2, size); 100 return bb_full_fd_action(fd1, fd2, size);
@@ -102,7 +102,7 @@ off_t bb_copyfd_size(int fd1, int fd2, off_t size)
102 return 0; 102 return 0;
103} 103}
104 104
105void bb_copyfd_exact_size(int fd1, int fd2, off_t size) 105void FAST_FUNC bb_copyfd_exact_size(int fd1, int fd2, off_t size)
106{ 106{
107 off_t sz = bb_copyfd_size(fd1, fd2, size); 107 off_t sz = bb_copyfd_size(fd1, fd2, size);
108 if (sz == size) 108 if (sz == size)
@@ -113,7 +113,7 @@ void bb_copyfd_exact_size(int fd1, int fd2, off_t size)
113 xfunc_die(); 113 xfunc_die();
114} 114}
115 115
116off_t bb_copyfd_eof(int fd1, int fd2) 116off_t FAST_FUNC bb_copyfd_eof(int fd1, int fd2)
117{ 117{
118 return bb_full_fd_action(fd1, fd2, 0); 118 return bb_full_fd_action(fd1, fd2, 0);
119} 119}
diff --git a/libbb/correct_password.c b/libbb/correct_password.c
index f47642fd5..255b04870 100644
--- a/libbb/correct_password.c
+++ b/libbb/correct_password.c
@@ -36,7 +36,7 @@
36 * 36 *
37 * NULL pw means "just fake it for login with bad username" */ 37 * NULL pw means "just fake it for login with bad username" */
38 38
39int correct_password(const struct passwd *pw) 39int FAST_FUNC correct_password(const struct passwd *pw)
40{ 40{
41 char *unencrypted, *encrypted; 41 char *unencrypted, *encrypted;
42 const char *correct; 42 const char *correct;
diff --git a/libbb/crc32.c b/libbb/crc32.c
index acbc45827..42079b9c5 100644
--- a/libbb/crc32.c
+++ b/libbb/crc32.c
@@ -16,7 +16,7 @@
16 16
17#include "libbb.h" 17#include "libbb.h"
18 18
19uint32_t *crc32_filltable(uint32_t *crc_table, int endian) 19uint32_t* FAST_FUNC crc32_filltable(uint32_t *crc_table, int endian)
20{ 20{
21 uint32_t polynomial = endian ? 0x04c11db7 : 0xedb88320; 21 uint32_t polynomial = endian ? 0x04c11db7 : 0xedb88320;
22 uint32_t c; 22 uint32_t c;
diff --git a/libbb/create_icmp6_socket.c b/libbb/create_icmp6_socket.c
index a22ac5d02..20655170e 100644
--- a/libbb/create_icmp6_socket.c
+++ b/libbb/create_icmp6_socket.c
@@ -9,7 +9,7 @@
9#include "libbb.h" 9#include "libbb.h"
10 10
11#if ENABLE_FEATURE_IPV6 11#if ENABLE_FEATURE_IPV6
12int create_icmp6_socket(void) 12int FAST_FUNC create_icmp6_socket(void)
13{ 13{
14 int sock; 14 int sock;
15#if 0 15#if 0
diff --git a/libbb/create_icmp_socket.c b/libbb/create_icmp_socket.c
index 64beba82b..1fa016ab8 100644
--- a/libbb/create_icmp_socket.c
+++ b/libbb/create_icmp_socket.c
@@ -8,7 +8,7 @@
8 8
9#include "libbb.h" 9#include "libbb.h"
10 10
11int create_icmp_socket(void) 11int FAST_FUNC create_icmp_socket(void)
12{ 12{
13 int sock; 13 int sock;
14#if 0 14#if 0
diff --git a/libbb/crypt_make_salt.c b/libbb/crypt_make_salt.c
index ebdf02420..393eba5f9 100644
--- a/libbb/crypt_make_salt.c
+++ b/libbb/crypt_make_salt.c
@@ -24,7 +24,7 @@ static int i64c(int i)
24 return ('a' - 38 + i); 24 return ('a' - 38 + i);
25} 25}
26 26
27int crypt_make_salt(char *p, int cnt, int x) 27int FAST_FUNC crypt_make_salt(char *p, int cnt, int x)
28{ 28{
29 x += getpid() + time(NULL); 29 x += getpid() + time(NULL);
30 do { 30 do {
diff --git a/libbb/device_open.c b/libbb/device_open.c
index 6907e9814..cf8bcf646 100644
--- a/libbb/device_open.c
+++ b/libbb/device_open.c
@@ -10,7 +10,7 @@
10#include "libbb.h" 10#include "libbb.h"
11 11
12/* try to open up the specified device */ 12/* try to open up the specified device */
13int device_open(const char *device, int mode) 13int FAST_FUNC device_open(const char *device, int mode)
14{ 14{
15 int m, f, fd; 15 int m, f, fd;
16 16
diff --git a/libbb/die_if_bad_username.c b/libbb/die_if_bad_username.c
index 337ac6012..602aadc0c 100644
--- a/libbb/die_if_bad_username.c
+++ b/libbb/die_if_bad_username.c
@@ -16,7 +16,7 @@
16 * at the end of the username. 16 * at the end of the username.
17 */ 17 */
18 18
19void die_if_bad_username(const char *name) 19void FAST_FUNC die_if_bad_username(const char *name)
20{ 20{
21 goto skip; /* 1st char being dash isn't valid */ 21 goto skip; /* 1st char being dash isn't valid */
22 do { 22 do {
diff --git a/libbb/dump.c b/libbb/dump.c
index 4d6472e37..c45595285 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -33,7 +33,7 @@ static const char size_conv_str[] ALIGN1 =
33 33
34static const char lcc[] ALIGN1 = "diouxX"; 34static const char lcc[] ALIGN1 = "diouxX";
35 35
36int bb_dump_size(FS * fs) 36int FAST_FUNC bb_dump_size(FS *fs)
37{ 37{
38 FU *fu; 38 FU *fu;
39 int bcnt, cur_size; 39 int bcnt, cur_size;
@@ -652,7 +652,7 @@ static void display(void)
652 } 652 }
653} 653}
654 654
655int bb_dump_dump(char **argv) 655int FAST_FUNC bb_dump_dump(char **argv)
656{ 656{
657 FS *tfs; 657 FS *tfs;
658 658
@@ -674,7 +674,7 @@ int bb_dump_dump(char **argv)
674 return exitval; 674 return exitval;
675} 675}
676 676
677void bb_dump_add(const char *fmt) 677void FAST_FUNC bb_dump_add(const char *fmt)
678{ 678{
679 const char *p; 679 const char *p;
680 char *p1; 680 char *p1;
diff --git a/libbb/error_msg.c b/libbb/error_msg.c
index 5f53f0311..802fd5715 100644
--- a/libbb/error_msg.c
+++ b/libbb/error_msg.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void bb_error_msg(const char *s, ...) 12void FAST_FUNC bb_error_msg(const char *s, ...)
13{ 13{
14 va_list p; 14 va_list p;
15 15
diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c
index addd818b7..243433b2d 100644
--- a/libbb/error_msg_and_die.c
+++ b/libbb/error_msg_and_die.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void bb_error_msg_and_die(const char *s, ...) 12void FAST_FUNC bb_error_msg_and_die(const char *s, ...)
13{ 13{
14 va_list p; 14 va_list p;
15 15
diff --git a/libbb/execable.c b/libbb/execable.c
index 5c2b4505c..5c7ac16a2 100644
--- a/libbb/execable.c
+++ b/libbb/execable.c
@@ -13,7 +13,7 @@
13 * return 1 if found; 13 * return 1 if found;
14 * return 0 otherwise; 14 * return 0 otherwise;
15 */ 15 */
16int execable_file(const char *name) 16int FAST_FUNC execable_file(const char *name)
17{ 17{
18 struct stat s; 18 struct stat s;
19 return (!access(name, X_OK) && !stat(name, &s) && S_ISREG(s.st_mode)); 19 return (!access(name, X_OK) && !stat(name, &s) && S_ISREG(s.st_mode));
@@ -28,7 +28,7 @@ int execable_file(const char *name)
28 * return NULL otherwise; (PATHp is undefined) 28 * return NULL otherwise; (PATHp is undefined)
29 * in all cases (*PATHp) contents will be trashed (s/:/NUL/). 29 * in all cases (*PATHp) contents will be trashed (s/:/NUL/).
30 */ 30 */
31char *find_execable(const char *filename, char **PATHp) 31char* FAST_FUNC find_execable(const char *filename, char **PATHp)
32{ 32{
33 char *p, *n; 33 char *p, *n;
34 34
@@ -54,7 +54,7 @@ char *find_execable(const char *filename, char **PATHp)
54 * return 1 if found; 54 * return 1 if found;
55 * return 0 otherwise; 55 * return 0 otherwise;
56 */ 56 */
57int exists_execable(const char *filename) 57int FAST_FUNC exists_execable(const char *filename)
58{ 58{
59 char *path = xstrdup(getenv("PATH")); 59 char *path = xstrdup(getenv("PATH"));
60 char *tmp = path; 60 char *tmp = path;
@@ -70,7 +70,7 @@ int exists_execable(const char *filename)
70#if ENABLE_FEATURE_PREFER_APPLETS 70#if ENABLE_FEATURE_PREFER_APPLETS
71/* just like the real execvp, but try to launch an applet named 'file' first 71/* just like the real execvp, but try to launch an applet named 'file' first
72 */ 72 */
73int bb_execvp(const char *file, char *const argv[]) 73int FAST_FUNC bb_execvp(const char *file, char *const argv[])
74{ 74{
75 return execvp(find_applet_by_name(file) >= 0 ? bb_busybox_exec_path : file, 75 return execvp(find_applet_by_name(file) >= 0 ? bb_busybox_exec_path : file,
76 argv); 76 argv);
diff --git a/libbb/fclose_nonstdin.c b/libbb/fclose_nonstdin.c
index 768ee946d..6f3f37332 100644
--- a/libbb/fclose_nonstdin.c
+++ b/libbb/fclose_nonstdin.c
@@ -14,7 +14,7 @@
14 14
15#include "libbb.h" 15#include "libbb.h"
16 16
17int fclose_if_not_stdin(FILE *f) 17int FAST_FUNC fclose_if_not_stdin(FILE *f)
18{ 18{
19 /* Some more paranoid applets want ferror() check too */ 19 /* Some more paranoid applets want ferror() check too */
20 int r = ferror(f); /* NB: does NOT set errno! */ 20 int r = ferror(f); /* NB: does NOT set errno! */
diff --git a/libbb/fflush_stdout_and_exit.c b/libbb/fflush_stdout_and_exit.c
index 9f05500f3..742fb9f58 100644
--- a/libbb/fflush_stdout_and_exit.c
+++ b/libbb/fflush_stdout_and_exit.c
@@ -13,7 +13,7 @@
13 13
14#include "libbb.h" 14#include "libbb.h"
15 15
16void fflush_stdout_and_exit(int retval) 16void FAST_FUNC fflush_stdout_and_exit(int retval)
17{ 17{
18 if (fflush(stdout)) 18 if (fflush(stdout))
19 bb_perror_msg_and_die(bb_msg_standard_output); 19 bb_perror_msg_and_die(bb_msg_standard_output);
diff --git a/libbb/fgets_str.c b/libbb/fgets_str.c
index d6fada1a1..8026a15da 100644
--- a/libbb/fgets_str.c
+++ b/libbb/fgets_str.c
@@ -55,12 +55,12 @@ static char *xmalloc_fgets_internal(FILE *file, const char *terminating_string,
55 * including terminating string. 55 * including terminating string.
56 * Non-terminated string can be returned if EOF is reached. 56 * Non-terminated string can be returned if EOF is reached.
57 * Return NULL if EOF is reached immediately. */ 57 * Return NULL if EOF is reached immediately. */
58char *xmalloc_fgets_str(FILE *file, const char *terminating_string) 58char* FAST_FUNC xmalloc_fgets_str(FILE *file, const char *terminating_string)
59{ 59{
60 return xmalloc_fgets_internal(file, terminating_string, 0); 60 return xmalloc_fgets_internal(file, terminating_string, 0);
61} 61}
62 62
63char *xmalloc_fgetline_str(FILE *file, const char *terminating_string) 63char* FAST_FUNC xmalloc_fgetline_str(FILE *file, const char *terminating_string)
64{ 64{
65 return xmalloc_fgets_internal(file, terminating_string, 1); 65 return xmalloc_fgets_internal(file, terminating_string, 1);
66} 66}
diff --git a/libbb/find_mount_point.c b/libbb/find_mount_point.c
index cb00b9806..4cd6b1618 100644
--- a/libbb/find_mount_point.c
+++ b/libbb/find_mount_point.c
@@ -17,7 +17,7 @@
17 * Given any other file (or directory), find the mount table entry for its 17 * Given any other file (or directory), find the mount table entry for its
18 * filesystem. 18 * filesystem.
19 */ 19 */
20struct mntent *find_mount_point(const char *name, const char *table) 20struct mntent* FAST_FUNC find_mount_point(const char *name, const char *table)
21{ 21{
22 struct stat s; 22 struct stat s;
23 dev_t mountDevice; 23 dev_t mountDevice;
diff --git a/libbb/find_pid_by_name.c b/libbb/find_pid_by_name.c
index 8dcdb13bc..ae2f11643 100644
--- a/libbb/find_pid_by_name.c
+++ b/libbb/find_pid_by_name.c
@@ -48,7 +48,7 @@ and therefore comm field contains "exe".
48 * Returns a list of all matching PIDs 48 * Returns a list of all matching PIDs
49 * It is the caller's duty to free the returned pidlist. 49 * It is the caller's duty to free the returned pidlist.
50 */ 50 */
51pid_t* find_pid_by_name(const char* procName) 51pid_t* FAST_FUNC find_pid_by_name(const char* procName)
52{ 52{
53 pid_t* pidList; 53 pid_t* pidList;
54 int i = 0; 54 int i = 0;
@@ -74,7 +74,7 @@ pid_t* find_pid_by_name(const char* procName)
74 return pidList; 74 return pidList;
75} 75}
76 76
77pid_t *pidlist_reverse(pid_t *pidList) 77pid_t* FAST_FUNC pidlist_reverse(pid_t *pidList)
78{ 78{
79 int i = 0; 79 int i = 0;
80 while (pidList[i]) 80 while (pidList[i])
diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c
index 9779f7e82..ca46bf535 100644
--- a/libbb/find_root_device.c
+++ b/libbb/find_root_device.c
@@ -62,7 +62,7 @@ static char *find_block_device_in_dir(struct arena *ap)
62 return retpath; 62 return retpath;
63} 63}
64 64
65char *find_block_device(const char *path) 65char* FAST_FUNC find_block_device(const char *path)
66{ 66{
67 struct arena a; 67 struct arena a;
68 68
diff --git a/libbb/full_write.c b/libbb/full_write.c
index 7503c8b42..f353b7d55 100644
--- a/libbb/full_write.c
+++ b/libbb/full_write.c
@@ -14,7 +14,7 @@
14 * This does multiple writes as necessary. 14 * This does multiple writes as necessary.
15 * Returns the amount written, or -1 on an error. 15 * Returns the amount written, or -1 on an error.
16 */ 16 */
17ssize_t full_write(int fd, const void *buf, size_t len) 17ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len)
18{ 18{
19 ssize_t cc; 19 ssize_t cc;
20 ssize_t total; 20 ssize_t total;
diff --git a/libbb/get_console.c b/libbb/get_console.c
index 36fe20426..d042afa2b 100644
--- a/libbb/get_console.c
+++ b/libbb/get_console.c
@@ -38,7 +38,7 @@ static int open_a_console(const char *fnam)
38 * if someone else used X (which does a chown on /dev/console). 38 * if someone else used X (which does a chown on /dev/console).
39 */ 39 */
40 40
41int get_console_fd(void) 41int FAST_FUNC get_console_fd(void)
42{ 42{
43 static const char *const console_names[] = { 43 static const char *const console_names[] = {
44 DEV_CONSOLE, CURRENT_VC, CURRENT_TTY 44 DEV_CONSOLE, CURRENT_VC, CURRENT_TTY
@@ -75,7 +75,7 @@ enum {
75 VT_WAITACTIVE = 0x5607 /* wait for vt active */ 75 VT_WAITACTIVE = 0x5607 /* wait for vt active */
76}; 76};
77 77
78void console_make_active(int fd, const int vt_num) 78void FAST_FUNC console_make_active(int fd, const int vt_num)
79{ 79{
80 xioctl(fd, VT_ACTIVATE, (void *)(ptrdiff_t)vt_num); 80 xioctl(fd, VT_ACTIVATE, (void *)(ptrdiff_t)vt_num);
81 xioctl(fd, VT_WAITACTIVE, (void *)(ptrdiff_t)vt_num); 81 xioctl(fd, VT_WAITACTIVE, (void *)(ptrdiff_t)vt_num);
diff --git a/libbb/get_last_path_component.c b/libbb/get_last_path_component.c
index 0f602157d..7c99116e9 100644
--- a/libbb/get_last_path_component.c
+++ b/libbb/get_last_path_component.c
@@ -14,7 +14,7 @@
14 * "abc/def" -> "def" 14 * "abc/def" -> "def"
15 * "abc/def/" -> "" 15 * "abc/def/" -> ""
16 */ 16 */
17char *bb_get_last_path_component_nostrip(const char *path) 17char* FAST_FUNC bb_get_last_path_component_nostrip(const char *path)
18{ 18{
19 char *slash = strrchr(path, '/'); 19 char *slash = strrchr(path, '/');
20 20
@@ -30,7 +30,7 @@ char *bb_get_last_path_component_nostrip(const char *path)
30 * "abc/def" -> "def" 30 * "abc/def" -> "def"
31 * "abc/def/" -> "def" !! 31 * "abc/def/" -> "def" !!
32 */ 32 */
33char *bb_get_last_path_component_strip(char *path) 33char* FAST_FUNC bb_get_last_path_component_strip(char *path)
34{ 34{
35 char *slash = last_char_is(path, '/'); 35 char *slash = last_char_is(path, '/');
36 36
diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
index b88872d53..66ea5a1a5 100644
--- a/libbb/get_line_from_file.c
+++ b/libbb/get_line_from_file.c
@@ -16,7 +16,7 @@
16 * must be free'ed by the caller. If end is NULL '\n' isn't considered 16 * must be free'ed by the caller. If end is NULL '\n' isn't considered
17 * end of line. If end isn't NULL, length of the chunk read is stored in it. 17 * end of line. If end isn't NULL, length of the chunk read is stored in it.
18 * Return NULL if EOF/error */ 18 * Return NULL if EOF/error */
19char *bb_get_chunk_from_file(FILE *file, int *end) 19char* FAST_FUNC bb_get_chunk_from_file(FILE *file, int *end)
20{ 20{
21 int ch; 21 int ch;
22 int idx = 0; 22 int idx = 0;
@@ -49,7 +49,7 @@ char *bb_get_chunk_from_file(FILE *file, int *end)
49} 49}
50 50
51/* Get line, including trailing \n if any */ 51/* Get line, including trailing \n if any */
52char *xmalloc_fgets(FILE *file) 52char* FAST_FUNC xmalloc_fgets(FILE *file)
53{ 53{
54 int i; 54 int i;
55 55
@@ -57,7 +57,7 @@ char *xmalloc_fgets(FILE *file)
57} 57}
58 58
59/* Get line. Remove trailing \n */ 59/* Get line. Remove trailing \n */
60char *xmalloc_fgetline(FILE *file) 60char* FAST_FUNC xmalloc_fgetline(FILE *file)
61{ 61{
62 int i; 62 int i;
63 char *c = bb_get_chunk_from_file(file, &i); 63 char *c = bb_get_chunk_from_file(file, &i);
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index 86c33483b..9dba44db2 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -316,7 +316,7 @@ const char *applet_long_options;
316 316
317uint32_t option_mask32; 317uint32_t option_mask32;
318 318
319uint32_t 319uint32_t FAST_FUNC
320getopt32(char **argv, const char *applet_opts, ...) 320getopt32(char **argv, const char *applet_opts, ...)
321{ 321{
322 int argc; 322 int argc;
diff --git a/libbb/getpty.c b/libbb/getpty.c
index d43fb825f..bc143c291 100644
--- a/libbb/getpty.c
+++ b/libbb/getpty.c
@@ -10,7 +10,7 @@
10 10
11#define DEBUG 0 11#define DEBUG 0
12 12
13int xgetpty(char *line) 13int FAST_FUNC xgetpty(char *line)
14{ 14{
15 int p; 15 int p;
16#if ENABLE_FEATURE_DEVPTS 16#if ENABLE_FEATURE_DEVPTS
diff --git a/libbb/herror_msg.c b/libbb/herror_msg.c
index 264690ba0..7e4f64045 100644
--- a/libbb/herror_msg.c
+++ b/libbb/herror_msg.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void bb_herror_msg(const char *s, ...) 12void FAST_FUNC bb_herror_msg(const char *s, ...)
13{ 13{
14 va_list p; 14 va_list p;
15 15
diff --git a/libbb/herror_msg_and_die.c b/libbb/herror_msg_and_die.c
index 894c80f38..230fe645a 100644
--- a/libbb/herror_msg_and_die.c
+++ b/libbb/herror_msg_and_die.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void bb_herror_msg_and_die(const char *s, ...) 12void FAST_FUNC bb_herror_msg_and_die(const char *s, ...)
13{ 13{
14 va_list p; 14 va_list p;
15 15
diff --git a/libbb/human_readable.c b/libbb/human_readable.c
index d60ef61d7..dad26edcf 100644
--- a/libbb/human_readable.c
+++ b/libbb/human_readable.c
@@ -28,7 +28,7 @@
28 28
29#include "libbb.h" 29#include "libbb.h"
30 30
31const char *make_human_readable_str(unsigned long long size, 31const char* FAST_FUNC make_human_readable_str(unsigned long long size,
32 unsigned long block_size, unsigned long display_unit) 32 unsigned long block_size, unsigned long display_unit)
33{ 33{
34 /* The code will adjust for additional (appended) units */ 34 /* The code will adjust for additional (appended) units */
diff --git a/libbb/inet_common.c b/libbb/inet_common.c
index 9c4f49649..3a20b4a16 100644
--- a/libbb/inet_common.c
+++ b/libbb/inet_common.c
@@ -11,7 +11,7 @@
11#include "libbb.h" 11#include "libbb.h"
12#include "inet_common.h" 12#include "inet_common.h"
13 13
14int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) 14int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
15{ 15{
16 struct hostent *hp; 16 struct hostent *hp;
17#if ENABLE_FEATURE_ETC_NETWORKS 17#if ENABLE_FEATURE_ETC_NETWORKS
@@ -81,7 +81,7 @@ int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
81 * & 0x4000: host instead of net, 81 * & 0x4000: host instead of net,
82 * & 0x0fff: don't resolve 82 * & 0x0fff: don't resolve
83 */ 83 */
84char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) 84char* FAST_FUNC INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask)
85{ 85{
86 /* addr-to-name cache */ 86 /* addr-to-name cache */
87 struct addr { 87 struct addr {
@@ -165,7 +165,7 @@ char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask)
165 165
166#if ENABLE_FEATURE_IPV6 166#if ENABLE_FEATURE_IPV6
167 167
168int INET6_resolve(const char *name, struct sockaddr_in6 *sin6) 168int FAST_FUNC INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
169{ 169{
170 struct addrinfo req, *ai; 170 struct addrinfo req, *ai;
171 int s; 171 int s;
@@ -189,7 +189,7 @@ int INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
189#endif 189#endif
190 190
191 191
192char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) 192char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
193{ 193{
194 char name[128]; 194 char name[128];
195 int s; 195 int s;
diff --git a/libbb/info_msg.c b/libbb/info_msg.c
index 3231bc8cf..ffef05e54 100644
--- a/libbb/info_msg.c
+++ b/libbb/info_msg.c
@@ -10,7 +10,7 @@
10#include "libbb.h" 10#include "libbb.h"
11#include <syslog.h> 11#include <syslog.h>
12 12
13void bb_info_msg(const char *s, ...) 13void FAST_FUNC bb_info_msg(const char *s, ...)
14{ 14{
15 va_list p; 15 va_list p;
16 /* va_copy is used because it is not portable 16 /* va_copy is used because it is not portable
diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c
index 9cca74bcb..4469671dd 100644
--- a/libbb/inode_hash.c
+++ b/libbb/inode_hash.c
@@ -27,7 +27,7 @@ static ino_dev_hashtable_bucket_t **ino_dev_hashtable;
27 * Return name if statbuf->st_ino && statbuf->st_dev are recorded in 27 * Return name if statbuf->st_ino && statbuf->st_dev are recorded in
28 * ino_dev_hashtable, else return NULL 28 * ino_dev_hashtable, else return NULL
29 */ 29 */
30char *is_in_ino_dev_hashtable(const struct stat *statbuf) 30char* FAST_FUNC is_in_ino_dev_hashtable(const struct stat *statbuf)
31{ 31{
32 ino_dev_hashtable_bucket_t *bucket; 32 ino_dev_hashtable_bucket_t *bucket;
33 33
@@ -47,7 +47,7 @@ char *is_in_ino_dev_hashtable(const struct stat *statbuf)
47} 47}
48 48
49/* Add statbuf to statbuf hash table */ 49/* Add statbuf to statbuf hash table */
50void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) 50void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name)
51{ 51{
52 int i; 52 int i;
53 ino_dev_hashtable_bucket_t *bucket; 53 ino_dev_hashtable_bucket_t *bucket;
@@ -69,7 +69,7 @@ void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name)
69 69
70#if ENABLE_FEATURE_CLEAN_UP 70#if ENABLE_FEATURE_CLEAN_UP
71/* Clear statbuf hash table */ 71/* Clear statbuf hash table */
72void reset_ino_dev_hashtable(void) 72void FAST_FUNC reset_ino_dev_hashtable(void)
73{ 73{
74 int i; 74 int i;
75 ino_dev_hashtable_bucket_t *bucket; 75 ino_dev_hashtable_bucket_t *bucket;
diff --git a/libbb/isdirectory.c b/libbb/isdirectory.c
index 1d2477f47..28ed3ec29 100644
--- a/libbb/isdirectory.c
+++ b/libbb/isdirectory.c
@@ -15,7 +15,7 @@
15 * Return TRUE if fileName is a directory. 15 * Return TRUE if fileName is a directory.
16 * Nonexistent files return FALSE. 16 * Nonexistent files return FALSE.
17 */ 17 */
18int is_directory(const char *fileName, const int followLinks, struct stat *statBuf) 18int FAST_FUNC is_directory(const char *fileName, const int followLinks, struct stat *statBuf)
19{ 19{
20 int status; 20 int status;
21 struct stat astatBuf; 21 struct stat astatBuf;
diff --git a/libbb/kernel_version.c b/libbb/kernel_version.c
index 50b82ae18..8b9c4ec20 100644
--- a/libbb/kernel_version.c
+++ b/libbb/kernel_version.c
@@ -16,7 +16,7 @@
16 * 16 *
17 * if (get_linux_version_code() > KERNEL_VERSION(2,2,11)) { <stuff> } 17 * if (get_linux_version_code() > KERNEL_VERSION(2,2,11)) { <stuff> }
18 */ 18 */
19int get_linux_version_code(void) 19int FAST_FUNC get_linux_version_code(void)
20{ 20{
21 struct utsname name; 21 struct utsname name;
22 char *s; 22 char *s;
diff --git a/libbb/last_char_is.c b/libbb/last_char_is.c
index aaa85ddd9..b0592568c 100644
--- a/libbb/last_char_is.c
+++ b/libbb/last_char_is.c
@@ -12,7 +12,7 @@
12/* Find out if the last character of a string matches the one given. 12/* Find out if the last character of a string matches the one given.
13 * Don't underrun the buffer if the string length is 0. 13 * Don't underrun the buffer if the string length is 0.
14 */ 14 */
15char* last_char_is(const char *s, int c) 15char* FAST_FUNC last_char_is(const char *s, int c)
16{ 16{
17 if (s && *s) { 17 if (s && *s) {
18 size_t sz = strlen(s) - 1; 18 size_t sz = strlen(s) - 1;
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index fb595c010..42f372fb9 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1352,7 +1352,7 @@ static void win_changed(int nsig)
1352 * 0 on ctrl-C (the line entered is still returned in 'command'), 1352 * 0 on ctrl-C (the line entered is still returned in 'command'),
1353 * >0 length of input string, including terminating '\n' 1353 * >0 length of input string, including terminating '\n'
1354 */ 1354 */
1355int read_line_input(const char *prompt, char *command, int maxsize, line_input_t *st) 1355int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, line_input_t *st)
1356{ 1356{
1357#if ENABLE_FEATURE_TAB_COMPLETION 1357#if ENABLE_FEATURE_TAB_COMPLETION
1358 smallint lastWasTab = FALSE; 1358 smallint lastWasTab = FALSE;
@@ -1845,7 +1845,7 @@ int read_line_input(const char *prompt, char *command, int maxsize, line_input_t
1845 return command_len; 1845 return command_len;
1846} 1846}
1847 1847
1848line_input_t *new_line_input_t(int flags) 1848line_input_t* FAST_FUNC new_line_input_t(int flags)
1849{ 1849{
1850 line_input_t *n = xzalloc(sizeof(*n)); 1850 line_input_t *n = xzalloc(sizeof(*n));
1851 n->flags = flags; 1851 n->flags = flags;
@@ -1855,7 +1855,7 @@ line_input_t *new_line_input_t(int flags)
1855#else 1855#else
1856 1856
1857#undef read_line_input 1857#undef read_line_input
1858int read_line_input(const char* prompt, char* command, int maxsize) 1858int FAST_FUNC read_line_input(const char* prompt, char* command, int maxsize)
1859{ 1859{
1860 fputs(prompt, stdout); 1860 fputs(prompt, stdout);
1861 fflush(stdout); 1861 fflush(stdout);
diff --git a/libbb/llist.c b/libbb/llist.c
index 4b3971bbe..094c65246 100644
--- a/libbb/llist.c
+++ b/libbb/llist.c
@@ -13,7 +13,7 @@
13#include "libbb.h" 13#include "libbb.h"
14 14
15/* Add data to the start of the linked list. */ 15/* Add data to the start of the linked list. */
16void llist_add_to(llist_t **old_head, void *data) 16void FAST_FUNC llist_add_to(llist_t **old_head, void *data)
17{ 17{
18 llist_t *new_head = xmalloc(sizeof(llist_t)); 18 llist_t *new_head = xmalloc(sizeof(llist_t));
19 19
@@ -23,7 +23,7 @@ void llist_add_to(llist_t **old_head, void *data)
23} 23}
24 24
25/* Add data to the end of the linked list. */ 25/* Add data to the end of the linked list. */
26void llist_add_to_end(llist_t **list_head, void *data) 26void FAST_FUNC llist_add_to_end(llist_t **list_head, void *data)
27{ 27{
28 llist_t *new_item = xmalloc(sizeof(llist_t)); 28 llist_t *new_item = xmalloc(sizeof(llist_t));
29 29
@@ -42,7 +42,7 @@ void llist_add_to_end(llist_t **list_head, void *data)
42} 42}
43 43
44/* Remove first element from the list and return it */ 44/* Remove first element from the list and return it */
45void *llist_pop(llist_t **head) 45void* FAST_FUNC llist_pop(llist_t **head)
46{ 46{
47 void *data, *next; 47 void *data, *next;
48 48
@@ -58,7 +58,7 @@ void *llist_pop(llist_t **head)
58} 58}
59 59
60/* Unlink arbitrary given element from the list */ 60/* Unlink arbitrary given element from the list */
61void llist_unlink(llist_t **head, llist_t *elm) 61void FAST_FUNC llist_unlink(llist_t **head, llist_t *elm)
62{ 62{
63 llist_t *crt; 63 llist_t *crt;
64 64
@@ -80,7 +80,7 @@ void llist_unlink(llist_t **head, llist_t *elm)
80 80
81/* Recursively free all elements in the linked list. If freeit != NULL 81/* Recursively free all elements in the linked list. If freeit != NULL
82 * call it on each datum in the list */ 82 * call it on each datum in the list */
83void llist_free(llist_t *elm, void (*freeit) (void *data)) 83void FAST_FUNC llist_free(llist_t *elm, void (*freeit) (void *data))
84{ 84{
85 while (elm) { 85 while (elm) {
86 void *data = llist_pop(&elm); 86 void *data = llist_pop(&elm);
@@ -92,7 +92,7 @@ void llist_free(llist_t *elm, void (*freeit) (void *data))
92 92
93#ifdef UNUSED 93#ifdef UNUSED
94/* Reverse list order. */ 94/* Reverse list order. */
95llist_t *llist_rev(llist_t *list) 95llist_t* FAST_FUNC llist_rev(llist_t *list)
96{ 96{
97 llist_t *rev = NULL; 97 llist_t *rev = NULL;
98 98
diff --git a/libbb/login.c b/libbb/login.c
index a5be2c8c9..346ff13eb 100644
--- a/libbb/login.c
+++ b/libbb/login.c
@@ -18,7 +18,7 @@
18static const char fmtstr_d[] ALIGN1 = "%A, %d %B %Y"; 18static const char fmtstr_d[] ALIGN1 = "%A, %d %B %Y";
19static const char fmtstr_t[] ALIGN1 = "%H:%M:%S"; 19static const char fmtstr_t[] ALIGN1 = "%H:%M:%S";
20 20
21void print_login_issue(const char *issue_file, const char *tty) 21void FAST_FUNC print_login_issue(const char *issue_file, const char *tty)
22{ 22{
23 FILE *fd; 23 FILE *fd;
24 int c; 24 int c;
@@ -86,7 +86,7 @@ void print_login_issue(const char *issue_file, const char *tty)
86 fflush(stdout); 86 fflush(stdout);
87} 87}
88 88
89void print_login_prompt(void) 89void FAST_FUNC print_login_prompt(void)
90{ 90{
91 char *hostname = safe_gethostname(); 91 char *hostname = safe_gethostname();
92 92
@@ -112,7 +112,7 @@ static const char forbid[] ALIGN1 =
112 "LD_NOWARN" "\0" 112 "LD_NOWARN" "\0"
113 "LD_KEEPDIR" "\0"; 113 "LD_KEEPDIR" "\0";
114 114
115int sanitize_env_if_suid(void) 115int FAST_FUNC sanitize_env_if_suid(void)
116{ 116{
117 const char *p; 117 const char *p;
118 118
diff --git a/libbb/loop.c b/libbb/loop.c
index 6934b7a3b..7d2b420be 100644
--- a/libbb/loop.c
+++ b/libbb/loop.c
@@ -44,7 +44,7 @@ typedef struct {
44} bb_loop_info; 44} bb_loop_info;
45#endif 45#endif
46 46
47char *query_loop(const char *device) 47char* FAST_FUNC query_loop(const char *device)
48{ 48{
49 int fd; 49 int fd;
50 bb_loop_info loopinfo; 50 bb_loop_info loopinfo;
@@ -61,7 +61,7 @@ char *query_loop(const char *device)
61} 61}
62 62
63 63
64int del_loop(const char *device) 64int FAST_FUNC del_loop(const char *device)
65{ 65{
66 int fd, rc; 66 int fd, rc;
67 67
@@ -79,7 +79,7 @@ int del_loop(const char *device)
79 search will re-use an existing loop device already bound to that 79 search will re-use an existing loop device already bound to that
80 file/offset if it finds one. 80 file/offset if it finds one.
81 */ 81 */
82int set_loop(char **device, const char *file, unsigned long long offset) 82int FAST_FUNC set_loop(char **device, const char *file, unsigned long long offset)
83{ 83{
84 char dev[LOOP_NAMESIZE]; 84 char dev[LOOP_NAMESIZE];
85 char *try; 85 char *try;
diff --git a/libbb/make_directory.c b/libbb/make_directory.c
index 8841c95d3..5c71aff92 100644
--- a/libbb/make_directory.c
+++ b/libbb/make_directory.c
@@ -26,7 +26,7 @@
26 26
27/* This function is used from NOFORK applets. It must not allocate anything */ 27/* This function is used from NOFORK applets. It must not allocate anything */
28 28
29int bb_make_directory (char *path, long mode, int flags) 29int FAST_FUNC bb_make_directory(char *path, long mode, int flags)
30{ 30{
31 mode_t mask; 31 mode_t mask;
32 const char *fail_msg; 32 const char *fail_msg;
diff --git a/libbb/match_fstype.c b/libbb/match_fstype.c
index bd4dbb064..99e276784 100644
--- a/libbb/match_fstype.c
+++ b/libbb/match_fstype.c
@@ -12,7 +12,7 @@
12 12
13#include "libbb.h" 13#include "libbb.h"
14 14
15int match_fstype(const struct mntent *mt, const char *fstype) 15int FAST_FUNC match_fstype(const struct mntent *mt, const char *fstype)
16{ 16{
17 int no = 0; 17 int no = 0;
18 int len; 18 int len;
diff --git a/libbb/md5.c b/libbb/md5.c
index 8d4b9fe52..4ab06eb17 100644
--- a/libbb/md5.c
+++ b/libbb/md5.c
@@ -24,7 +24,7 @@
24/* Initialize structure containing state of computation. 24/* Initialize structure containing state of computation.
25 * (RFC 1321, 3.3: Step 3) 25 * (RFC 1321, 3.3: Step 3)
26 */ 26 */
27void md5_begin(md5_ctx_t *ctx) 27void FAST_FUNC md5_begin(md5_ctx_t *ctx)
28{ 28{
29 ctx->A = 0x67452301; 29 ctx->A = 0x67452301;
30 ctx->B = 0xefcdab89; 30 ctx->B = 0xefcdab89;
@@ -371,7 +371,7 @@ static void md5_hash_block(const void *buffer, md5_ctx_t *ctx)
371 * This function's internal buffer remembers previous data until it has 64 371 * This function's internal buffer remembers previous data until it has 64
372 * bytes worth to pass on. Call md5_end() to flush this buffer. */ 372 * bytes worth to pass on. Call md5_end() to flush this buffer. */
373 373
374void md5_hash(const void *buffer, size_t len, md5_ctx_t *ctx) 374void FAST_FUNC md5_hash(const void *buffer, size_t len, md5_ctx_t *ctx)
375{ 375{
376 char *buf=(char *)buffer; 376 char *buf=(char *)buffer;
377 377
@@ -410,7 +410,7 @@ void md5_hash(const void *buffer, size_t len, md5_ctx_t *ctx)
410 * IMPORTANT: On some systems it is required that RESBUF is correctly 410 * IMPORTANT: On some systems it is required that RESBUF is correctly
411 * aligned for a 32 bits value. 411 * aligned for a 32 bits value.
412 */ 412 */
413void *md5_end(void *resbuf, md5_ctx_t *ctx) 413void* FAST_FUNC md5_end(void *resbuf, md5_ctx_t *ctx)
414{ 414{
415 char *buf = ctx->buffer; 415 char *buf = ctx->buffer;
416 int i; 416 int i;
diff --git a/libbb/mode_string.c b/libbb/mode_string.c
index d17cc4a43..b9975f4cc 100644
--- a/libbb/mode_string.c
+++ b/libbb/mode_string.c
@@ -51,7 +51,7 @@ static const char type_chars[16] ALIGN1 = "?pc?d?b?-?l?s???";
51/* 0123456789abcdef */ 51/* 0123456789abcdef */
52static const char mode_chars[7] ALIGN1 = "rwxSTst"; 52static const char mode_chars[7] ALIGN1 = "rwxSTst";
53 53
54const char *bb_mode_string(mode_t mode) 54const char* FAST_FUNC bb_mode_string(mode_t mode)
55{ 55{
56 static char buf[12]; 56 static char buf[12];
57 char *p = buf; 57 char *p = buf;
@@ -91,7 +91,7 @@ static const char type_chars[16] = "?pc?d?b?-?l?s???";
91/* 0123456789abcdef */ 91/* 0123456789abcdef */
92static const char mode_chars[7] = "rwxSTst"; 92static const char mode_chars[7] = "rwxSTst";
93 93
94const char *bb_mode_string(mode_t mode) 94const char* FAST_FUNC bb_mode_string(mode_t mode)
95{ 95{
96 static char buf[12]; 96 static char buf[12];
97 char *p = buf; 97 char *p = buf;
diff --git a/libbb/mtab.c b/libbb/mtab.c
index 18386efb5..57654a695 100644
--- a/libbb/mtab.c
+++ b/libbb/mtab.c
@@ -11,7 +11,7 @@
11#include "libbb.h" 11#include "libbb.h"
12 12
13#if ENABLE_FEATURE_MTAB_SUPPORT 13#if ENABLE_FEATURE_MTAB_SUPPORT
14void erase_mtab(const char *name) 14void FAST_FUNC erase_mtab(const char *name)
15{ 15{
16 struct mntent *entries = NULL; 16 struct mntent *entries = NULL;
17 int i, count = 0; 17 int i, count = 0;
diff --git a/libbb/obscure.c b/libbb/obscure.c
index 1841b27d6..19b87523e 100644
--- a/libbb/obscure.c
+++ b/libbb/obscure.c
@@ -157,7 +157,7 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc
157 return NULL; 157 return NULL;
158} 158}
159 159
160int obscure(const char *old, const char *newval, const struct passwd *pw) 160int FAST_FUNC obscure(const char *old, const char *newval, const struct passwd *pw)
161{ 161{
162 const char *msg; 162 const char *msg;
163 163
diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c
index fd5490039..40105dd3a 100644
--- a/libbb/parse_mode.c
+++ b/libbb/parse_mode.c
@@ -15,7 +15,7 @@
15 15
16#define FILEMODEBITS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) 16#define FILEMODEBITS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
17 17
18int bb_parse_mode(const char *s, mode_t *current_mode) 18int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
19{ 19{
20 static const mode_t who_mask[] = { 20 static const mode_t who_mask[] = {
21 S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO, /* a */ 21 S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO, /* a */
diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c
index af9ff5949..6c8e1b51e 100644
--- a/libbb/perror_msg.c
+++ b/libbb/perror_msg.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void bb_perror_msg(const char *s, ...) 12void FAST_FUNC bb_perror_msg(const char *s, ...)
13{ 13{
14 va_list p; 14 va_list p;
15 15
@@ -19,7 +19,7 @@ void bb_perror_msg(const char *s, ...)
19 va_end(p); 19 va_end(p);
20} 20}
21 21
22void bb_simple_perror_msg(const char *s) 22void FAST_FUNC bb_simple_perror_msg(const char *s)
23{ 23{
24 bb_perror_msg("%s", s); 24 bb_perror_msg("%s", s);
25} 25}
diff --git a/libbb/perror_msg_and_die.c b/libbb/perror_msg_and_die.c
index 7b500736a..15615fa22 100644
--- a/libbb/perror_msg_and_die.c
+++ b/libbb/perror_msg_and_die.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void bb_perror_msg_and_die(const char *s, ...) 12void FAST_FUNC bb_perror_msg_and_die(const char *s, ...)
13{ 13{
14 va_list p; 14 va_list p;
15 15
@@ -20,7 +20,7 @@ void bb_perror_msg_and_die(const char *s, ...)
20 xfunc_die(); 20 xfunc_die();
21} 21}
22 22
23void bb_simple_perror_msg_and_die(const char *s) 23void FAST_FUNC bb_simple_perror_msg_and_die(const char *s)
24{ 24{
25 bb_perror_msg_and_die("%s", s); 25 bb_perror_msg_and_die("%s", s);
26} 26}
diff --git a/libbb/perror_nomsg.c b/libbb/perror_nomsg.c
index 62ce888ae..a157caa1f 100644
--- a/libbb/perror_nomsg.c
+++ b/libbb/perror_nomsg.c
@@ -11,11 +11,12 @@
11 * modified definition without "attribute (format)" 11 * modified definition without "attribute (format)"
12 * instead of including libbb.h */ 12 * instead of including libbb.h */
13//#include "libbb.h" 13//#include "libbb.h"
14extern void bb_perror_msg(const char *s, ...); 14#include "platform.h"
15extern void bb_perror_msg(const char *s, ...) FAST_FUNC;
15 16
16/* suppress gcc "no previous prototype" warning */ 17/* suppress gcc "no previous prototype" warning */
17void bb_perror_nomsg(void); 18void FAST_FUNC bb_perror_nomsg(void);
18void bb_perror_nomsg(void) 19void FAST_FUNC bb_perror_nomsg(void)
19{ 20{
20 bb_perror_msg(0); 21 bb_perror_msg(0);
21} 22}
diff --git a/libbb/perror_nomsg_and_die.c b/libbb/perror_nomsg_and_die.c
index dab3df60a..d56e05d32 100644
--- a/libbb/perror_nomsg_and_die.c
+++ b/libbb/perror_nomsg_and_die.c
@@ -11,11 +11,12 @@
11 * modified definition without "attribute (format)" 11 * modified definition without "attribute (format)"
12 * instead of including libbb.h */ 12 * instead of including libbb.h */
13//#include "libbb.h" 13//#include "libbb.h"
14extern void bb_perror_msg_and_die(const char *s, ...); 14#include "platform.h"
15extern void bb_perror_msg_and_die(const char *s, ...) FAST_FUNC;
15 16
16/* suppress gcc "no previous prototype" warning */ 17/* suppress gcc "no previous prototype" warning */
17void bb_perror_nomsg_and_die(void); 18void FAST_FUNC bb_perror_nomsg_and_die(void);
18void bb_perror_nomsg_and_die(void) 19void FAST_FUNC bb_perror_nomsg_and_die(void)
19{ 20{
20 bb_perror_msg_and_die(0); 21 bb_perror_msg_and_die(0);
21} 22}
diff --git a/libbb/pidfile.c b/libbb/pidfile.c
index cafa7891f..7b8fee21c 100644
--- a/libbb/pidfile.c
+++ b/libbb/pidfile.c
@@ -13,7 +13,7 @@
13 13
14smallint wrote_pidfile; 14smallint wrote_pidfile;
15 15
16void write_pidfile(const char *path) 16void FAST_FUNC write_pidfile(const char *path)
17{ 17{
18 int pid_fd; 18 int pid_fd;
19 char *end; 19 char *end;
diff --git a/libbb/print_flags.c b/libbb/print_flags.c
index a1dcc01ec..a8c4f9c1f 100644
--- a/libbb/print_flags.c
+++ b/libbb/print_flags.c
@@ -9,7 +9,7 @@
9#include <libbb.h> 9#include <libbb.h>
10 10
11/* returns a set with the flags not printed */ 11/* returns a set with the flags not printed */
12int print_flags_separated(const int *masks, const char *labels, int flags, const char *separator) 12int FAST_FUNC print_flags_separated(const int *masks, const char *labels, int flags, const char *separator)
13{ 13{
14 const char *need_separator = NULL; 14 const char *need_separator = NULL;
15 while (*labels) { 15 while (*labels) {
@@ -19,14 +19,14 @@ int print_flags_separated(const int *masks, const char *labels, int flags, const
19 labels); 19 labels);
20 need_separator = separator; 20 need_separator = separator;
21 flags &= ~ *masks; 21 flags &= ~ *masks;
22 masks++;
22 } 23 }
23 masks++;
24 labels += strlen(labels) + 1; 24 labels += strlen(labels) + 1;
25 } 25 }
26 return flags; 26 return flags;
27} 27}
28 28
29int print_flags(const masks_labels_t *ml, int flags) 29int FAST_FUNC print_flags(const masks_labels_t *ml, int flags)
30{ 30{
31 return print_flags_separated(ml->masks, ml->labels, flags, NULL); 31 return print_flags_separated(ml->masks, ml->labels, flags, NULL);
32} 32}
diff --git a/libbb/printable.c b/libbb/printable.c
index 676758a2b..ae9335932 100644
--- a/libbb/printable.c
+++ b/libbb/printable.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void fputc_printable(int ch, FILE *file) 12void FAST_FUNC fputc_printable(int ch, FILE *file)
13{ 13{
14 if ((ch & (0x80 + PRINTABLE_META)) == (0x80 + PRINTABLE_META)) { 14 if ((ch & (0x80 + PRINTABLE_META)) == (0x80 + PRINTABLE_META)) {
15 fputs("M-", file); 15 fputs("M-", file);
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c
index 1cadbd373..4d03bd61f 100644
--- a/libbb/process_escape_sequence.c
+++ b/libbb/process_escape_sequence.c
@@ -16,7 +16,7 @@
16#undef _tolower 16#undef _tolower
17#define _tolower(X) ((X)|((char) 0x20)) 17#define _tolower(X) ((X)|((char) 0x20))
18 18
19char bb_process_escape_sequence(const char **ptr) 19char FAST_FUNC bb_process_escape_sequence(const char **ptr)
20{ 20{
21 static const char charmap[] ALIGN1 = { 21 static const char charmap[] ALIGN1 = {
22 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0, 22 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0,
diff --git a/libbb/procps.c b/libbb/procps.c
index 8946917a2..7d49d83ce 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -30,7 +30,7 @@ static void clear_cache(cache_t *cp)
30 cp->cache = NULL; 30 cp->cache = NULL;
31 cp->size = 0; 31 cp->size = 0;
32} 32}
33void clear_username_cache(void) 33void FAST_FUNC clear_username_cache(void)
34{ 34{
35 clear_cache(&username); 35 clear_cache(&username);
36 clear_cache(&groupname); 36 clear_cache(&groupname);
@@ -52,7 +52,7 @@ static int get_cached(cache_t *cp, unsigned id)
52} 52}
53#endif 53#endif
54 54
55typedef char* ug_func(char *name, int bufsize, long uid); 55typedef char* FAST_FUNC ug_func(char *name, int bufsize, long uid);
56static char* get_cached(cache_t *cp, unsigned id, ug_func* fp) 56static char* get_cached(cache_t *cp, unsigned id, ug_func* fp)
57{ 57{
58 int i; 58 int i;
@@ -66,11 +66,11 @@ static char* get_cached(cache_t *cp, unsigned id, ug_func* fp)
66 fp(cp->cache[i].name, sizeof(cp->cache[i].name), id); 66 fp(cp->cache[i].name, sizeof(cp->cache[i].name), id);
67 return cp->cache[i].name; 67 return cp->cache[i].name;
68} 68}
69const char* get_cached_username(uid_t uid) 69const char* FAST_FUNC get_cached_username(uid_t uid)
70{ 70{
71 return get_cached(&username, uid, bb_getpwuid); 71 return get_cached(&username, uid, bb_getpwuid);
72} 72}
73const char* get_cached_groupname(gid_t gid) 73const char* FAST_FUNC get_cached_groupname(gid_t gid)
74{ 74{
75 return get_cached(&groupname, gid, bb_getgrgid); 75 return get_cached(&groupname, gid, bb_getgrgid);
76} 76}
@@ -78,7 +78,7 @@ const char* get_cached_groupname(gid_t gid)
78 78
79#define PROCPS_BUFSIZE 1024 79#define PROCPS_BUFSIZE 1024
80 80
81static int read_to_buf(const char *filename, void *buf) 81static int FAST_FUNC read_to_buf(const char *filename, void *buf)
82{ 82{
83 int fd; 83 int fd;
84 /* open_read_close() would do two reads, checking for EOF. 84 /* open_read_close() would do two reads, checking for EOF.
@@ -93,7 +93,7 @@ static int read_to_buf(const char *filename, void *buf)
93 return ret; 93 return ret;
94} 94}
95 95
96static procps_status_t *alloc_procps_scan(void) 96static procps_status_t* FAST_FUNC alloc_procps_scan(void)
97{ 97{
98 unsigned n = getpagesize(); 98 unsigned n = getpagesize();
99 procps_status_t* sp = xzalloc(sizeof(procps_status_t)); 99 procps_status_t* sp = xzalloc(sizeof(procps_status_t));
@@ -107,7 +107,7 @@ static procps_status_t *alloc_procps_scan(void)
107 return sp; 107 return sp;
108} 108}
109 109
110void free_procps_scan(procps_status_t* sp) 110void FAST_FUNC free_procps_scan(procps_status_t* sp)
111{ 111{
112 closedir(sp->dir); 112 closedir(sp->dir);
113 free(sp->argv0); 113 free(sp->argv0);
@@ -163,7 +163,7 @@ static char *skip_fields(char *str, int count)
163#endif 163#endif
164 164
165void BUG_comm_size(void); 165void BUG_comm_size(void);
166procps_status_t *procps_scan(procps_status_t* sp, int flags) 166procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags)
167{ 167{
168 struct dirent *entry; 168 struct dirent *entry;
169 char buf[PROCPS_BUFSIZE]; 169 char buf[PROCPS_BUFSIZE];
@@ -402,7 +402,7 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
402 return sp; 402 return sp;
403} 403}
404 404
405void read_cmdline(char *buf, int col, unsigned pid, const char *comm) 405void FAST_FUNC read_cmdline(char *buf, int col, unsigned pid, const char *comm)
406{ 406{
407 ssize_t sz; 407 ssize_t sz;
408 char filename[sizeof("/proc//cmdline") + sizeof(int)*3]; 408 char filename[sizeof("/proc//cmdline") + sizeof(int)*3];
diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c
index 73631865c..469e71f6c 100644
--- a/libbb/pw_encrypt.c
+++ b/libbb/pw_encrypt.c
@@ -50,7 +50,7 @@ static void my_crypt_cleanup(void)
50 des_ctx = NULL; 50 des_ctx = NULL;
51} 51}
52 52
53char *pw_encrypt(const char *clear, const char *salt, int cleanup) 53char* FAST_FUNC pw_encrypt(const char *clear, const char *salt, int cleanup)
54{ 54{
55 char *encrypted; 55 char *encrypted;
56 56
@@ -70,7 +70,7 @@ char *pw_encrypt(const char *clear, const char *salt, int cleanup)
70 70
71#else /* if !ENABLE_USE_BB_CRYPT */ 71#else /* if !ENABLE_USE_BB_CRYPT */
72 72
73char *pw_encrypt(const char *clear, const char *salt, int cleanup) 73char* FAST_FUNC pw_encrypt(const char *clear, const char *salt, int cleanup)
74{ 74{
75#if 0 /* was CONFIG_FEATURE_SHA1_PASSWORDS, but there is no such thing??? */ 75#if 0 /* was CONFIG_FEATURE_SHA1_PASSWORDS, but there is no such thing??? */
76 if (strncmp(salt, "$2$", 3) == 0) { 76 if (strncmp(salt, "$2$", 3) == 0) {
diff --git a/libbb/read.c b/libbb/read.c
index fa9874d31..7b804125a 100644
--- a/libbb/read.c
+++ b/libbb/read.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12ssize_t safe_read(int fd, void *buf, size_t count) 12ssize_t FAST_FUNC safe_read(int fd, void *buf, size_t count)
13{ 13{
14 ssize_t n; 14 ssize_t n;
15 15
@@ -56,7 +56,7 @@ ssize_t safe_read(int fd, void *buf, size_t count)
56 * which detects EAGAIN and uses poll() to wait on the fd. 56 * which detects EAGAIN and uses poll() to wait on the fd.
57 * Thankfully, poll() doesn't care about O_NONBLOCK flag. 57 * Thankfully, poll() doesn't care about O_NONBLOCK flag.
58 */ 58 */
59ssize_t nonblock_safe_read(int fd, void *buf, size_t count) 59ssize_t FAST_FUNC nonblock_safe_read(int fd, void *buf, size_t count)
60{ 60{
61 struct pollfd pfd[1]; 61 struct pollfd pfd[1];
62 ssize_t n; 62 ssize_t n;
@@ -78,7 +78,7 @@ ssize_t nonblock_safe_read(int fd, void *buf, size_t count)
78 * Returns the amount read, or -1 on an error. 78 * Returns the amount read, or -1 on an error.
79 * A short read is returned on an end of file. 79 * A short read is returned on an end of file.
80 */ 80 */
81ssize_t full_read(int fd, void *buf, size_t len) 81ssize_t FAST_FUNC full_read(int fd, void *buf, size_t len)
82{ 82{
83 ssize_t cc; 83 ssize_t cc;
84 ssize_t total; 84 ssize_t total;
@@ -107,7 +107,7 @@ ssize_t full_read(int fd, void *buf, size_t len)
107} 107}
108 108
109// Die with an error message if we can't read the entire buffer. 109// Die with an error message if we can't read the entire buffer.
110void xread(int fd, void *buf, size_t count) 110void FAST_FUNC xread(int fd, void *buf, size_t count)
111{ 111{
112 if (count) { 112 if (count) {
113 ssize_t size = full_read(fd, buf, count); 113 ssize_t size = full_read(fd, buf, count);
@@ -117,7 +117,7 @@ void xread(int fd, void *buf, size_t count)
117} 117}
118 118
119// Die with an error message if we can't read one character. 119// Die with an error message if we can't read one character.
120unsigned char xread_char(int fd) 120unsigned char FAST_FUNC xread_char(int fd)
121{ 121{
122 char tmp; 122 char tmp;
123 xread(fd, &tmp, 1); 123 xread(fd, &tmp, 1);
@@ -125,7 +125,7 @@ unsigned char xread_char(int fd)
125} 125}
126 126
127// Read one line a-la fgets. Works only on seekable streams 127// Read one line a-la fgets. Works only on seekable streams
128char *reads(int fd, char *buffer, size_t size) 128char* FAST_FUNC reads(int fd, char *buffer, size_t size)
129{ 129{
130 char *p; 130 char *p;
131 131
@@ -152,7 +152,7 @@ char *reads(int fd, char *buffer, size_t size)
152// Reads one line a-la fgets (but doesn't save terminating '\n'). 152// Reads one line a-la fgets (but doesn't save terminating '\n').
153// Reads byte-by-byte. Useful when it is important to not read ahead. 153// Reads byte-by-byte. Useful when it is important to not read ahead.
154// Bytes are appended to pfx (which must be malloced, or NULL). 154// Bytes are appended to pfx (which must be malloced, or NULL).
155char *xmalloc_reads(int fd, char *buf, size_t *maxsz_p) 155char* FAST_FUNC xmalloc_reads(int fd, char *buf, size_t *maxsz_p)
156{ 156{
157 char *p; 157 char *p;
158 size_t sz = buf ? strlen(buf) : 0; 158 size_t sz = buf ? strlen(buf) : 0;
@@ -185,7 +185,7 @@ char *xmalloc_reads(int fd, char *buf, size_t *maxsz_p)
185 return xrealloc(buf, p - buf); 185 return xrealloc(buf, p - buf);
186} 186}
187 187
188ssize_t read_close(int fd, void *buf, size_t size) 188ssize_t FAST_FUNC read_close(int fd, void *buf, size_t size)
189{ 189{
190 /*int e;*/ 190 /*int e;*/
191 size = full_read(fd, buf, size); 191 size = full_read(fd, buf, size);
@@ -195,7 +195,7 @@ ssize_t read_close(int fd, void *buf, size_t size)
195 return size; 195 return size;
196} 196}
197 197
198ssize_t open_read_close(const char *filename, void *buf, size_t size) 198ssize_t FAST_FUNC open_read_close(const char *filename, void *buf, size_t size)
199{ 199{
200 int fd = open(filename, O_RDONLY); 200 int fd = open(filename, O_RDONLY);
201 if (fd < 0) 201 if (fd < 0)
@@ -205,7 +205,7 @@ ssize_t open_read_close(const char *filename, void *buf, size_t size)
205 205
206// Read (potentially big) files in one go. File size is estimated 206// Read (potentially big) files in one go. File size is estimated
207// by stat. 207// by stat.
208void *xmalloc_open_read_close(const char *filename, size_t *sizep) 208void* FAST_FUNC xmalloc_open_read_close(const char *filename, size_t *sizep)
209{ 209{
210 char *buf; 210 char *buf;
211 size_t size; 211 size_t size;
@@ -247,7 +247,7 @@ void *xmalloc_open_read_close(const char *filename, size_t *sizep)
247 247
248// Read (potentially big) files in one go. File size is estimated by 248// Read (potentially big) files in one go. File size is estimated by
249// lseek to end. 249// lseek to end.
250void *xmalloc_open_read_close(const char *filename, size_t *sizep) 250void* FAST_FUNC xmalloc_open_read_close(const char *filename, size_t *sizep)
251{ 251{
252 char *buf; 252 char *buf;
253 size_t size; 253 size_t size;
@@ -284,7 +284,7 @@ void *xmalloc_open_read_close(const char *filename, size_t *sizep)
284} 284}
285#endif 285#endif
286 286
287void *xmalloc_xopen_read_close(const char *filename, size_t *sizep) 287void* FAST_FUNC xmalloc_xopen_read_close(const char *filename, size_t *sizep)
288{ 288{
289 void *buf = xmalloc_open_read_close(filename, sizep); 289 void *buf = xmalloc_open_read_close(filename, sizep);
290 if (!buf) 290 if (!buf)
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c
index fe9ba2ecc..9b6951f43 100644
--- a/libbb/recursive_action.c
+++ b/libbb/recursive_action.c
@@ -22,7 +22,7 @@
22 * is so stinking huge. 22 * is so stinking huge.
23 */ 23 */
24 24
25static int true_action(const char *fileName ATTRIBUTE_UNUSED, 25static int FAST_FUNC true_action(const char *fileName ATTRIBUTE_UNUSED,
26 struct stat *statbuf ATTRIBUTE_UNUSED, 26 struct stat *statbuf ATTRIBUTE_UNUSED,
27 void* userData ATTRIBUTE_UNUSED, 27 void* userData ATTRIBUTE_UNUSED,
28 int depth ATTRIBUTE_UNUSED) 28 int depth ATTRIBUTE_UNUSED)
@@ -53,10 +53,10 @@ static int true_action(const char *fileName ATTRIBUTE_UNUSED,
53 * 1: stat(statbuf). Calls dirAction and optionally recurse on link to dir. 53 * 1: stat(statbuf). Calls dirAction and optionally recurse on link to dir.
54 */ 54 */
55 55
56int recursive_action(const char *fileName, 56int FAST_FUNC recursive_action(const char *fileName,
57 unsigned flags, 57 unsigned flags,
58 int (*fileAction)(const char *fileName, struct stat *statbuf, void* userData, int depth), 58 int FAST_FUNC (*fileAction)(const char *fileName, struct stat *statbuf, void* userData, int depth),
59 int (*dirAction)(const char *fileName, struct stat *statbuf, void* userData, int depth), 59 int FAST_FUNC (*dirAction)(const char *fileName, struct stat *statbuf, void* userData, int depth),
60 void* userData, 60 void* userData,
61 unsigned depth) 61 unsigned depth)
62{ 62{
diff --git a/libbb/remove_file.c b/libbb/remove_file.c
index 21878dc3b..8b14f07c9 100644
--- a/libbb/remove_file.c
+++ b/libbb/remove_file.c
@@ -11,7 +11,7 @@
11 11
12/* Used from NOFORK applets. Must not allocate anything */ 12/* Used from NOFORK applets. Must not allocate anything */
13 13
14int remove_file(const char *path, int flags) 14int FAST_FUNC remove_file(const char *path, int flags)
15{ 15{
16 struct stat path_stat; 16 struct stat path_stat;
17 17
diff --git a/libbb/restricted_shell.c b/libbb/restricted_shell.c
index dc4cfb458..2a5073f03 100644
--- a/libbb/restricted_shell.c
+++ b/libbb/restricted_shell.c
@@ -32,7 +32,7 @@
32 32
33/* Return 1 if SHELL is a restricted shell (one not returned by 33/* Return 1 if SHELL is a restricted shell (one not returned by
34 getusershell), else 0, meaning it is a standard shell. */ 34 getusershell), else 0, meaning it is a standard shell. */
35int restricted_shell(const char *shell) 35int FAST_FUNC restricted_shell(const char *shell)
36{ 36{
37 char *line; 37 char *line;
38 38
diff --git a/libbb/rtc.c b/libbb/rtc.c
index 78f10c65d..1fdeee80f 100644
--- a/libbb/rtc.c
+++ b/libbb/rtc.c
@@ -11,7 +11,7 @@
11# define ADJTIME_PATH "/etc/adjtime" 11# define ADJTIME_PATH "/etc/adjtime"
12#endif 12#endif
13 13
14int rtc_adjtime_is_utc(void) 14int FAST_FUNC rtc_adjtime_is_utc(void)
15{ 15{
16 int utc = 0; 16 int utc = 0;
17 FILE *f = fopen(ADJTIME_PATH, "r"); 17 FILE *f = fopen(ADJTIME_PATH, "r");
@@ -40,7 +40,7 @@ int rtc_adjtime_is_utc(void)
40 return utc; 40 return utc;
41} 41}
42 42
43int rtc_xopen(const char **default_rtc, int flags) 43int FAST_FUNC rtc_xopen(const char **default_rtc, int flags)
44{ 44{
45 int rtc; 45 int rtc;
46 46
@@ -59,7 +59,7 @@ int rtc_xopen(const char **default_rtc, int flags)
59 return xopen(*default_rtc, flags); 59 return xopen(*default_rtc, flags);
60} 60}
61 61
62time_t rtc_read_time(int fd, int utc) 62time_t FAST_FUNC rtc_read_time(int fd, int utc)
63{ 63{
64 struct tm tm; 64 struct tm tm;
65 char *oldtz = 0; 65 char *oldtz = 0;
diff --git a/libbb/run_shell.c b/libbb/run_shell.c
index 239887d85..2ccb3a12c 100644
--- a/libbb/run_shell.c
+++ b/libbb/run_shell.c
@@ -36,14 +36,12 @@
36#if ENABLE_SELINUX 36#if ENABLE_SELINUX
37static security_context_t current_sid; 37static security_context_t current_sid;
38 38
39void 39void FAST_FUNC renew_current_security_context(void)
40renew_current_security_context(void)
41{ 40{
42 freecon(current_sid); /* Release old context */ 41 freecon(current_sid); /* Release old context */
43 getcon(&current_sid); /* update */ 42 getcon(&current_sid); /* update */
44} 43}
45void 44void FAST_FUNC set_current_security_context(security_context_t sid)
46set_current_security_context(security_context_t sid)
47{ 45{
48 freecon(current_sid); /* Release old context */ 46 freecon(current_sid); /* Release old context */
49 current_sid = sid; 47 current_sid = sid;
@@ -56,7 +54,7 @@ set_current_security_context(security_context_t sid)
56 If ADDITIONAL_ARGS is nonzero, pass it to the shell as more 54 If ADDITIONAL_ARGS is nonzero, pass it to the shell as more
57 arguments. */ 55 arguments. */
58 56
59void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) 57void FAST_FUNC run_shell(const char *shell, int loginshell, const char *command, const char **additional_args)
60{ 58{
61 const char **args; 59 const char **args;
62 int argno = 1; 60 int argno = 1;
diff --git a/libbb/safe_gethostname.c b/libbb/safe_gethostname.c
index 3b24edba5..1f8b2a8fd 100644
--- a/libbb/safe_gethostname.c
+++ b/libbb/safe_gethostname.c
@@ -33,7 +33,7 @@
33 * This is an illegal first character for a hostname. 33 * This is an illegal first character for a hostname.
34 * The returned malloced string must be freed by the caller. 34 * The returned malloced string must be freed by the caller.
35 */ 35 */
36char *safe_gethostname(void) 36char* FAST_FUNC safe_gethostname(void)
37{ 37{
38 struct utsname uts; 38 struct utsname uts;
39 39
diff --git a/libbb/safe_poll.c b/libbb/safe_poll.c
index d2b773c36..58c7bda5a 100644
--- a/libbb/safe_poll.c
+++ b/libbb/safe_poll.c
@@ -12,7 +12,7 @@
12/* Wrapper which restarts poll on EINTR or ENOMEM. 12/* Wrapper which restarts poll on EINTR or ENOMEM.
13 * On other errors does perror("poll") and returns. 13 * On other errors does perror("poll") and returns.
14 * Warning! May take longer than timeout_ms to return! */ 14 * Warning! May take longer than timeout_ms to return! */
15int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout) 15int FAST_FUNC safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout)
16{ 16{
17 while (1) { 17 while (1) {
18 int n = poll(ufds, nfds, timeout); 18 int n = poll(ufds, nfds, timeout);
diff --git a/libbb/safe_strncpy.c b/libbb/safe_strncpy.c
index cc425839f..649fa10cf 100644
--- a/libbb/safe_strncpy.c
+++ b/libbb/safe_strncpy.c
@@ -10,7 +10,7 @@
10#include "libbb.h" 10#include "libbb.h"
11 11
12/* Like strncpy but make sure the resulting string is always 0 terminated. */ 12/* Like strncpy but make sure the resulting string is always 0 terminated. */
13char *safe_strncpy(char *dst, const char *src, size_t size) 13char* FAST_FUNC safe_strncpy(char *dst, const char *src, size_t size)
14{ 14{
15 if (!size) return dst; 15 if (!size) return dst;
16 dst[--size] = '\0'; 16 dst[--size] = '\0';
diff --git a/libbb/safe_write.c b/libbb/safe_write.c
index 5bbb82e84..e3561f3cf 100644
--- a/libbb/safe_write.c
+++ b/libbb/safe_write.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12ssize_t safe_write(int fd, const void *buf, size_t count) 12ssize_t FAST_FUNC safe_write(int fd, const void *buf, size_t count)
13{ 13{
14 ssize_t n; 14 ssize_t n;
15 15
diff --git a/libbb/selinux_common.c b/libbb/selinux_common.c
index 7478cc7b5..5fdbe9d58 100644
--- a/libbb/selinux_common.c
+++ b/libbb/selinux_common.c
@@ -7,7 +7,7 @@
7#include "libbb.h" 7#include "libbb.h"
8#include <selinux/context.h> 8#include <selinux/context.h>
9 9
10context_t set_security_context_component(security_context_t cur_context, 10context_t FAST_FUNC set_security_context_component(security_context_t cur_context,
11 char *user, char *role, char *type, char *range) 11 char *user, char *role, char *type, char *range)
12{ 12{
13 context_t con = context_new(cur_context); 13 context_t con = context_new(cur_context);
@@ -29,7 +29,7 @@ error:
29 return NULL; 29 return NULL;
30} 30}
31 31
32void setfscreatecon_or_die(security_context_t scontext) 32void FAST_FUNC setfscreatecon_or_die(security_context_t scontext)
33{ 33{
34 if (setfscreatecon(scontext) < 0) { 34 if (setfscreatecon(scontext) < 0) {
35 /* Can be NULL. All known printf implementations 35 /* Can be NULL. All known printf implementations
@@ -39,7 +39,7 @@ void setfscreatecon_or_die(security_context_t scontext)
39 } 39 }
40} 40}
41 41
42void selinux_preserve_fcontext(int fdesc) 42void FAST_FUNC selinux_preserve_fcontext(int fdesc)
43{ 43{
44 security_context_t context; 44 security_context_t context;
45 45
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c
index 6e3575cf9..04e333fed 100644
--- a/libbb/setup_environment.c
+++ b/libbb/setup_environment.c
@@ -30,7 +30,7 @@
30 30
31#include "libbb.h" 31#include "libbb.h"
32 32
33void setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw) 33void FAST_FUNC setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw)
34{ 34{
35 if (clear_env) { 35 if (clear_env) {
36 const char *term; 36 const char *term;
diff --git a/libbb/sha1.c b/libbb/sha1.c
index 552dcad80..cc7edd8a7 100644
--- a/libbb/sha1.c
+++ b/libbb/sha1.c
@@ -83,7 +83,7 @@ static void sha1_compile(sha1_ctx_t *ctx)
83 ctx->hash[4] += e; 83 ctx->hash[4] += e;
84} 84}
85 85
86void sha1_begin(sha1_ctx_t *ctx) 86void FAST_FUNC sha1_begin(sha1_ctx_t *ctx)
87{ 87{
88 ctx->count[0] = ctx->count[1] = 0; 88 ctx->count[0] = ctx->count[1] = 0;
89 ctx->hash[0] = 0x67452301; 89 ctx->hash[0] = 0x67452301;
@@ -95,7 +95,7 @@ void sha1_begin(sha1_ctx_t *ctx)
95 95
96/* SHA1 hash data in an array of bytes into hash buffer and call the */ 96/* SHA1 hash data in an array of bytes into hash buffer and call the */
97/* hash_compile function as required. */ 97/* hash_compile function as required. */
98void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) 98void FAST_FUNC sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx)
99{ 99{
100 uint32_t pos = (uint32_t) (ctx->count[0] & SHA1_MASK); 100 uint32_t pos = (uint32_t) (ctx->count[0] & SHA1_MASK);
101 uint32_t freeb = SHA1_BLOCK_SIZE - pos; 101 uint32_t freeb = SHA1_BLOCK_SIZE - pos;
@@ -116,7 +116,7 @@ void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx)
116 memcpy(((unsigned char *) ctx->wbuf) + pos, sp, length); 116 memcpy(((unsigned char *) ctx->wbuf) + pos, sp, length);
117} 117}
118 118
119void *sha1_end(void *resbuf, sha1_ctx_t *ctx) 119void* FAST_FUNC sha1_end(void *resbuf, sha1_ctx_t *ctx)
120{ 120{
121 /* SHA1 Final padding and digest calculation */ 121 /* SHA1 Final padding and digest calculation */
122#if BB_BIG_ENDIAN 122#if BB_BIG_ENDIAN
diff --git a/libbb/signals.c b/libbb/signals.c
index 1342c89a8..959114679 100644
--- a/libbb/signals.c
+++ b/libbb/signals.c
@@ -12,19 +12,19 @@
12#include "libbb.h" 12#include "libbb.h"
13 13
14/* Saves 2 bytes on x86! Oh my... */ 14/* Saves 2 bytes on x86! Oh my... */
15int sigaction_set(int signum, const struct sigaction *act) 15int FAST_FUNC sigaction_set(int signum, const struct sigaction *act)
16{ 16{
17 return sigaction(signum, act, NULL); 17 return sigaction(signum, act, NULL);
18} 18}
19 19
20int sigprocmask_allsigs(int how) 20int FAST_FUNC sigprocmask_allsigs(int how)
21{ 21{
22 sigset_t set; 22 sigset_t set;
23 sigfillset(&set); 23 sigfillset(&set);
24 return sigprocmask(how, &set, NULL); 24 return sigprocmask(how, &set, NULL);
25} 25}
26 26
27void bb_signals(int sigs, void (*f)(int)) 27void FAST_FUNC bb_signals(int sigs, void (*f)(int))
28{ 28{
29 int sig_no = 0; 29 int sig_no = 0;
30 int bit = 1; 30 int bit = 1;
@@ -39,7 +39,7 @@ void bb_signals(int sigs, void (*f)(int))
39 } 39 }
40} 40}
41 41
42void bb_signals_recursive(int sigs, void (*f)(int)) 42void FAST_FUNC bb_signals_recursive(int sigs, void (*f)(int))
43{ 43{
44 int sig_no = 0; 44 int sig_no = 0;
45 int bit = 1; 45 int bit = 1;
@@ -60,7 +60,7 @@ void bb_signals_recursive(int sigs, void (*f)(int))
60 } 60 }
61} 61}
62 62
63void sig_block(int sig) 63void FAST_FUNC sig_block(int sig)
64{ 64{
65 sigset_t ss; 65 sigset_t ss;
66 sigemptyset(&ss); 66 sigemptyset(&ss);
@@ -68,7 +68,7 @@ void sig_block(int sig)
68 sigprocmask(SIG_BLOCK, &ss, NULL); 68 sigprocmask(SIG_BLOCK, &ss, NULL);
69} 69}
70 70
71void sig_unblock(int sig) 71void FAST_FUNC sig_unblock(int sig)
72{ 72{
73 sigset_t ss; 73 sigset_t ss;
74 sigemptyset(&ss); 74 sigemptyset(&ss);
@@ -76,7 +76,7 @@ void sig_unblock(int sig)
76 sigprocmask(SIG_UNBLOCK, &ss, NULL); 76 sigprocmask(SIG_UNBLOCK, &ss, NULL);
77} 77}
78 78
79void wait_for_any_sig(void) 79void FAST_FUNC wait_for_any_sig(void)
80{ 80{
81 sigset_t ss; 81 sigset_t ss;
82 sigemptyset(&ss); 82 sigemptyset(&ss);
@@ -84,7 +84,7 @@ void wait_for_any_sig(void)
84} 84}
85 85
86/* Assuming the sig is fatal */ 86/* Assuming the sig is fatal */
87void kill_myself_with_sig(int sig) 87void FAST_FUNC kill_myself_with_sig(int sig)
88{ 88{
89 signal(sig, SIG_DFL); 89 signal(sig, SIG_DFL);
90 sig_unblock(sig); 90 sig_unblock(sig);
@@ -92,7 +92,7 @@ void kill_myself_with_sig(int sig)
92 _exit(EXIT_FAILURE); /* Should not reach it */ 92 _exit(EXIT_FAILURE); /* Should not reach it */
93} 93}
94 94
95void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) 95void FAST_FUNC signal_SA_RESTART_empty_mask(int sig, void (*handler)(int))
96{ 96{
97 struct sigaction sa; 97 struct sigaction sa;
98 memset(&sa, 0, sizeof(sa)); 98 memset(&sa, 0, sizeof(sa));
@@ -102,7 +102,7 @@ void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int))
102 sigaction_set(sig, &sa); 102 sigaction_set(sig, &sa);
103} 103}
104 104
105void signal_no_SA_RESTART_empty_mask(int sig, void (*handler)(int)) 105void FAST_FUNC signal_no_SA_RESTART_empty_mask(int sig, void (*handler)(int))
106{ 106{
107 struct sigaction sa; 107 struct sigaction sa;
108 memset(&sa, 0, sizeof(sa)); 108 memset(&sa, 0, sizeof(sa));
diff --git a/libbb/simplify_path.c b/libbb/simplify_path.c
index 29e371df6..367f1f04d 100644
--- a/libbb/simplify_path.c
+++ b/libbb/simplify_path.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12char *bb_simplify_path(const char *path) 12char* FAST_FUNC bb_simplify_path(const char *path)
13{ 13{
14 char *s, *start, *p; 14 char *s, *start, *p;
15 15
diff --git a/libbb/skip_whitespace.c b/libbb/skip_whitespace.c
index 87b5f23ba..e85f3859f 100644
--- a/libbb/skip_whitespace.c
+++ b/libbb/skip_whitespace.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12char *skip_whitespace(const char *s) 12char* FAST_FUNC skip_whitespace(const char *s)
13{ 13{
14 /* NB: isspace('\0') returns 0 */ 14 /* NB: isspace('\0') returns 0 */
15 while (isspace(*s)) ++s; 15 while (isspace(*s)) ++s;
@@ -17,7 +17,7 @@ char *skip_whitespace(const char *s)
17 return (char *) s; 17 return (char *) s;
18} 18}
19 19
20char *skip_non_whitespace(const char *s) 20char* FAST_FUNC skip_non_whitespace(const char *s)
21{ 21{
22 while (*s && !isspace(*s)) ++s; 22 while (*s && !isspace(*s)) ++s;
23 23
diff --git a/libbb/speed_table.c b/libbb/speed_table.c
index 94a296238..646f9146b 100644
--- a/libbb/speed_table.c
+++ b/libbb/speed_table.c
@@ -56,7 +56,7 @@ static const struct speed_map speeds[] = {
56 56
57enum { NUM_SPEEDS = ARRAY_SIZE(speeds) }; 57enum { NUM_SPEEDS = ARRAY_SIZE(speeds) };
58 58
59unsigned int tty_baud_to_value(speed_t speed) 59unsigned FAST_FUNC tty_baud_to_value(speed_t speed)
60{ 60{
61 int i = 0; 61 int i = 0;
62 62
@@ -72,7 +72,7 @@ unsigned int tty_baud_to_value(speed_t speed)
72 return 0; 72 return 0;
73} 73}
74 74
75speed_t tty_value_to_baud(unsigned int value) 75speed_t FAST_FUNC tty_value_to_baud(unsigned int value)
76{ 76{
77 int i = 0; 77 int i = 0;
78 78
diff --git a/libbb/str_tolower.c b/libbb/str_tolower.c
index 037f717c7..f402e8e6f 100644
--- a/libbb/str_tolower.c
+++ b/libbb/str_tolower.c
@@ -4,7 +4,8 @@
4 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 4 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
5 */ 5 */
6#include "libbb.h" 6#include "libbb.h"
7char* str_tolower(char *str) 7
8char* FAST_FUNC str_tolower(char *str)
8{ 9{
9 char *c; 10 char *c;
10 for (c = str; *c; ++c) 11 for (c = str; *c; ++c)
diff --git a/libbb/strrstr.c b/libbb/strrstr.c
index f61dd517f..d5cd44b2a 100644
--- a/libbb/strrstr.c
+++ b/libbb/strrstr.c
@@ -19,7 +19,7 @@
19 * The strrstr() function finds the last occurrence of the substring needle 19 * The strrstr() function finds the last occurrence of the substring needle
20 * in the string haystack. The terminating nul characters are not compared. 20 * in the string haystack. The terminating nul characters are not compared.
21 */ 21 */
22char* strrstr(const char *haystack, const char *needle) 22char* FAST_FUNC strrstr(const char *haystack, const char *needle)
23{ 23{
24 char *r = NULL; 24 char *r = NULL;
25 25
diff --git a/libbb/time.c b/libbb/time.c
index 07c009417..7d3ac9183 100644
--- a/libbb/time.c
+++ b/libbb/time.c
@@ -20,14 +20,14 @@
20 20
21/* libc has incredibly messy way of doing this, 21/* libc has incredibly messy way of doing this,
22 * typically requiring -lrt. We just skip all this mess */ 22 * typically requiring -lrt. We just skip all this mess */
23unsigned long long monotonic_us(void) 23unsigned long long FAST_FUNC monotonic_us(void)
24{ 24{
25 struct timespec ts; 25 struct timespec ts;
26 if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts)) 26 if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts))
27 bb_error_msg_and_die("clock_gettime(MONOTONIC) failed"); 27 bb_error_msg_and_die("clock_gettime(MONOTONIC) failed");
28 return ts.tv_sec * 1000000ULL + ts.tv_nsec/1000; 28 return ts.tv_sec * 1000000ULL + ts.tv_nsec/1000;
29} 29}
30unsigned monotonic_sec(void) 30unsigned FAST_FUNC monotonic_sec(void)
31{ 31{
32 struct timespec ts; 32 struct timespec ts;
33 if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts)) 33 if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts))
@@ -35,14 +35,14 @@ unsigned monotonic_sec(void)
35 return ts.tv_sec; 35 return ts.tv_sec;
36} 36}
37#else 37#else
38unsigned long long monotonic_us(void) 38unsigned long long FAST_FUNC monotonic_us(void)
39{ 39{
40 struct timeval tv; 40 struct timeval tv;
41 gettimeofday(&tv, NULL); 41 gettimeofday(&tv, NULL);
42 return tv.tv_sec * 1000000ULL + tv.tv_usec; 42 return tv.tv_sec * 1000000ULL + tv.tv_usec;
43} 43}
44 44
45unsigned monotonic_sec(void) 45unsigned FAST_FUNC monotonic_sec(void)
46{ 46{
47 return time(NULL); 47 return time(NULL);
48} 48}
diff --git a/libbb/trim.c b/libbb/trim.c
index 94ccaf7ed..ea20ff370 100644
--- a/libbb/trim.c
+++ b/libbb/trim.c
@@ -10,7 +10,7 @@
10 10
11#include "libbb.h" 11#include "libbb.h"
12 12
13void trim(char *s) 13void FAST_FUNC trim(char *s)
14{ 14{
15 size_t len = strlen(s); 15 size_t len = strlen(s);
16 size_t lws; 16 size_t lws;
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c
index 1dcbf5f2d..915eea579 100644
--- a/libbb/u_signal_names.c
+++ b/libbb/u_signal_names.c
@@ -121,7 +121,7 @@ static const char signals[][7] = {
121 121
122// Convert signal name to number. 122// Convert signal name to number.
123 123
124int get_signum(const char *name) 124int FAST_FUNC get_signum(const char *name)
125{ 125{
126 unsigned i; 126 unsigned i;
127 127
@@ -155,7 +155,7 @@ int get_signum(const char *name)
155 155
156// Convert signal number to name 156// Convert signal number to name
157 157
158const char *get_signame(int number) 158const char* FAST_FUNC get_signame(int number)
159{ 159{
160 if ((unsigned)number < ARRAY_SIZE(signals)) { 160 if ((unsigned)number < ARRAY_SIZE(signals)) {
161 if (signals[number][0]) /* if it's not an empty str */ 161 if (signals[number][0]) /* if it's not an empty str */
@@ -168,7 +168,7 @@ const char *get_signame(int number)
168 168
169// Print the whole signal list 169// Print the whole signal list
170 170
171void print_signames(void) 171void FAST_FUNC print_signames(void)
172{ 172{
173 unsigned signo; 173 unsigned signo;
174 174
diff --git a/libbb/udp_io.c b/libbb/udp_io.c
index c99e51643..b31f28416 100644
--- a/libbb/udp_io.c
+++ b/libbb/udp_io.c
@@ -13,7 +13,7 @@
13 * This asks kernel to let us know dst addr/port of incoming packets 13 * This asks kernel to let us know dst addr/port of incoming packets
14 * We don't check for errors here. Not supported == won't be used 14 * We don't check for errors here. Not supported == won't be used
15 */ 15 */
16void 16void FAST_FUNC
17socket_want_pktinfo(int fd) 17socket_want_pktinfo(int fd)
18{ 18{
19#ifdef IP_PKTINFO 19#ifdef IP_PKTINFO
@@ -25,7 +25,7 @@ socket_want_pktinfo(int fd)
25} 25}
26 26
27 27
28ssize_t 28ssize_t FAST_FUNC
29send_to_from(int fd, void *buf, size_t len, int flags, 29send_to_from(int fd, void *buf, size_t len, int flags,
30 const struct sockaddr *to, 30 const struct sockaddr *to,
31 const struct sockaddr *from, 31 const struct sockaddr *from,
@@ -100,7 +100,7 @@ send_to_from(int fd, void *buf, size_t len, int flags,
100 * _Only_ IP/IPv6 address part of 'to' is _maybe_ modified. 100 * _Only_ IP/IPv6 address part of 'to' is _maybe_ modified.
101 * Typical usage is to preinit 'to' with "default" value 101 * Typical usage is to preinit 'to' with "default" value
102 * before calling recv_from_to(). */ 102 * before calling recv_from_to(). */
103ssize_t 103ssize_t FAST_FUNC
104recv_from_to(int fd, void *buf, size_t len, int flags, 104recv_from_to(int fd, void *buf, size_t len, int flags,
105 struct sockaddr *from, struct sockaddr *to, 105 struct sockaddr *from, struct sockaddr *to,
106 socklen_t sa_size) 106 socklen_t sa_size)
diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c
index d10e863c6..88bc28ca9 100644
--- a/libbb/update_passwd.c
+++ b/libbb/update_passwd.c
@@ -36,7 +36,7 @@ static void check_selinux_update_passwd(const char *username)
36#define check_selinux_update_passwd(username) ((void)0) 36#define check_selinux_update_passwd(username) ((void)0)
37#endif 37#endif
38 38
39int update_passwd(const char *filename, const char *username, 39int FAST_FUNC update_passwd(const char *filename, const char *username,
40 const char *new_pw) 40 const char *new_pw)
41{ 41{
42 struct stat sb; 42 struct stat sb;
diff --git a/libbb/uuencode.c b/libbb/uuencode.c
index 0aedf3387..67d98d598 100644
--- a/libbb/uuencode.c
+++ b/libbb/uuencode.c
@@ -39,7 +39,7 @@ const char bb_uuenc_tbl_std[65] ALIGN1 = {
39 * buffer of at least 1+BASE64_LENGTH(length) bytes. 39 * buffer of at least 1+BASE64_LENGTH(length) bytes.
40 * where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3)) 40 * where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3))
41 */ 41 */
42void bb_uuencode(char *p, const void *src, int length, const char *tbl) 42void FAST_FUNC bb_uuencode(char *p, const void *src, int length, const char *tbl)
43{ 43{
44 const unsigned char *s = src; 44 const unsigned char *s = src;
45 45
diff --git a/libbb/vdprintf.c b/libbb/vdprintf.c
index 726d56374..09fffbca8 100644
--- a/libbb/vdprintf.c
+++ b/libbb/vdprintf.c
@@ -10,7 +10,7 @@
10#include "libbb.h" 10#include "libbb.h"
11 11
12#if defined(__GLIBC__) && __GLIBC__ < 2 12#if defined(__GLIBC__) && __GLIBC__ < 2
13int vdprintf(int d, const char *format, va_list ap) 13int FAST_FUNC vdprintf(int d, const char *format, va_list ap)
14{ 14{
15 char buf[BUF_SIZE]; 15 char buf[BUF_SIZE];
16 int len; 16 int len;
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c
index 5c6df48d4..58846d56e 100644
--- a/libbb/verror_msg.c
+++ b/libbb/verror_msg.c
@@ -13,7 +13,7 @@
13smallint logmode = LOGMODE_STDIO; 13smallint logmode = LOGMODE_STDIO;
14const char *msg_eol = "\n"; 14const char *msg_eol = "\n";
15 15
16void bb_verror_msg(const char *s, va_list p, const char* strerr) 16void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr)
17{ 17{
18 char *msg; 18 char *msg;
19 int applet_len, strerr_len, msgeol_len, used; 19 int applet_len, strerr_len, msgeol_len, used;
@@ -70,7 +70,7 @@ void bb_verror_msg(const char *s, va_list p, const char* strerr)
70/* Code size is approximately the same, but currently it's the only user 70/* Code size is approximately the same, but currently it's the only user
71 * of writev in entire bbox. __libc_writev in uclibc is ~50 bytes. */ 71 * of writev in entire bbox. __libc_writev in uclibc is ~50 bytes. */
72 72
73void bb_verror_msg(const char *s, va_list p, const char* strerr) 73void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr)
74{ 74{
75 int strerr_len, msgeol_len; 75 int strerr_len, msgeol_len;
76 struct iovec iov[3]; 76 struct iovec iov[3];
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 9624efbb9..37d4c274e 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -20,7 +20,7 @@
20 20
21/* This does a fork/exec in one call, using vfork(). Returns PID of new child, 21/* This does a fork/exec in one call, using vfork(). Returns PID of new child,
22 * -1 for failure. Runs argv[0], searching path if that has no / in it. */ 22 * -1 for failure. Runs argv[0], searching path if that has no / in it. */
23pid_t spawn(char **argv) 23pid_t FAST_FUNC spawn(char **argv)
24{ 24{
25 /* Compiler should not optimize stores here */ 25 /* Compiler should not optimize stores here */
26 volatile int failed; 26 volatile int failed;
@@ -58,7 +58,7 @@ pid_t spawn(char **argv)
58} 58}
59 59
60/* Die with an error message if we can't spawn a child process. */ 60/* Die with an error message if we can't spawn a child process. */
61pid_t xspawn(char **argv) 61pid_t FAST_FUNC xspawn(char **argv)
62{ 62{
63 pid_t pid = spawn(argv); 63 pid_t pid = spawn(argv);
64 if (pid < 0) 64 if (pid < 0)
@@ -66,7 +66,7 @@ pid_t xspawn(char **argv)
66 return pid; 66 return pid;
67} 67}
68 68
69int safe_waitpid(int pid, int *wstat, int options) 69int FAST_FUNC safe_waitpid(int pid, int *wstat, int options)
70{ 70{
71 int r; 71 int r;
72 72
@@ -76,13 +76,13 @@ int safe_waitpid(int pid, int *wstat, int options)
76 return r; 76 return r;
77} 77}
78 78
79int wait_any_nohang(int *wstat) 79int FAST_FUNC wait_any_nohang(int *wstat)
80{ 80{
81 return safe_waitpid(-1, wstat, WNOHANG); 81 return safe_waitpid(-1, wstat, WNOHANG);
82} 82}
83 83
84// Wait for the specified child PID to exit, returning child's error return. 84// Wait for the specified child PID to exit, returning child's error return.
85int wait4pid(int pid) 85int FAST_FUNC wait4pid(int pid)
86{ 86{
87 int status; 87 int status;
88 88
@@ -101,7 +101,7 @@ int wait4pid(int pid)
101} 101}
102 102
103#if ENABLE_FEATURE_PREFER_APPLETS 103#if ENABLE_FEATURE_PREFER_APPLETS
104void save_nofork_data(struct nofork_save_area *save) 104void FAST_FUNC save_nofork_data(struct nofork_save_area *save)
105{ 105{
106 memcpy(&save->die_jmp, &die_jmp, sizeof(die_jmp)); 106 memcpy(&save->die_jmp, &die_jmp, sizeof(die_jmp));
107 save->applet_name = applet_name; 107 save->applet_name = applet_name;
@@ -111,7 +111,7 @@ void save_nofork_data(struct nofork_save_area *save)
111 save->saved = 1; 111 save->saved = 1;
112} 112}
113 113
114void restore_nofork_data(struct nofork_save_area *save) 114void FAST_FUNC restore_nofork_data(struct nofork_save_area *save)
115{ 115{
116 memcpy(&die_jmp, &save->die_jmp, sizeof(die_jmp)); 116 memcpy(&die_jmp, &save->die_jmp, sizeof(die_jmp));
117 applet_name = save->applet_name; 117 applet_name = save->applet_name;
@@ -120,7 +120,7 @@ void restore_nofork_data(struct nofork_save_area *save)
120 die_sleep = save->die_sleep; 120 die_sleep = save->die_sleep;
121} 121}
122 122
123int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **argv) 123int FAST_FUNC run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **argv)
124{ 124{
125 int rc, argc; 125 int rc, argc;
126 126
@@ -166,7 +166,7 @@ int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **
166 return rc & 0xff; /* don't confuse people with "exitcodes" >255 */ 166 return rc & 0xff; /* don't confuse people with "exitcodes" >255 */
167} 167}
168 168
169int run_nofork_applet(int applet_no, char **argv) 169int FAST_FUNC run_nofork_applet(int applet_no, char **argv)
170{ 170{
171 struct nofork_save_area old; 171 struct nofork_save_area old;
172 172
@@ -176,7 +176,7 @@ int run_nofork_applet(int applet_no, char **argv)
176} 176}
177#endif /* FEATURE_PREFER_APPLETS */ 177#endif /* FEATURE_PREFER_APPLETS */
178 178
179int spawn_and_wait(char **argv) 179int FAST_FUNC spawn_and_wait(char **argv)
180{ 180{
181 int rc; 181 int rc;
182#if ENABLE_FEATURE_PREFER_APPLETS 182#if ENABLE_FEATURE_PREFER_APPLETS
@@ -210,7 +210,7 @@ int spawn_and_wait(char **argv)
210} 210}
211 211
212#if !BB_MMU 212#if !BB_MMU
213void re_exec(char **argv) 213void FAST_FUNC re_exec(char **argv)
214{ 214{
215 /* high-order bit of first char in argv[0] is a hidden 215 /* high-order bit of first char in argv[0] is a hidden
216 * "we have (already) re-execed, don't do it again" flag */ 216 * "we have (already) re-execed, don't do it again" flag */
@@ -219,7 +219,7 @@ void re_exec(char **argv)
219 bb_perror_msg_and_die("exec %s", bb_busybox_exec_path); 219 bb_perror_msg_and_die("exec %s", bb_busybox_exec_path);
220} 220}
221 221
222void forkexit_or_rexec(char **argv) 222void FAST_FUNC forkexit_or_rexec(char **argv)
223{ 223{
224 pid_t pid; 224 pid_t pid;
225 /* Maybe we are already re-execed and come here again? */ 225 /* Maybe we are already re-execed and come here again? */
@@ -237,7 +237,7 @@ void forkexit_or_rexec(char **argv)
237#else 237#else
238/* Dance around (void)...*/ 238/* Dance around (void)...*/
239#undef forkexit_or_rexec 239#undef forkexit_or_rexec
240void forkexit_or_rexec(void) 240void FAST_FUNC forkexit_or_rexec(void)
241{ 241{
242 pid_t pid; 242 pid_t pid;
243 pid = fork(); 243 pid = fork();
@@ -252,7 +252,7 @@ void forkexit_or_rexec(void)
252 252
253/* Due to a #define in libbb.h on MMU systems we actually have 1 argument - 253/* Due to a #define in libbb.h on MMU systems we actually have 1 argument -
254 * char **argv "vanishes" */ 254 * char **argv "vanishes" */
255void bb_daemonize_or_rexec(int flags, char **argv) 255void FAST_FUNC bb_daemonize_or_rexec(int flags, char **argv)
256{ 256{
257 int fd; 257 int fd;
258 258
@@ -286,7 +286,7 @@ void bb_daemonize_or_rexec(int flags, char **argv)
286 } 286 }
287} 287}
288 288
289void bb_sanitize_stdio(void) 289void FAST_FUNC bb_sanitize_stdio(void)
290{ 290{
291 bb_daemonize_or_rexec(DAEMON_ONLY_SANITIZE, NULL); 291 bb_daemonize_or_rexec(DAEMON_ONLY_SANITIZE, NULL);
292} 292}
diff --git a/libbb/warn_ignoring_args.c b/libbb/warn_ignoring_args.c
index be78a4414..65dea321a 100644
--- a/libbb/warn_ignoring_args.c
+++ b/libbb/warn_ignoring_args.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12void bb_warn_ignoring_args(int n) 12void FAST_FUNC bb_warn_ignoring_args(int n)
13{ 13{
14 if (n) { 14 if (n) {
15 bb_error_msg("ignoring all arguments"); 15 bb_error_msg("ignoring all arguments");
diff --git a/libbb/wfopen.c b/libbb/wfopen.c
index 9248874a7..ac365c2a0 100644
--- a/libbb/wfopen.c
+++ b/libbb/wfopen.c
@@ -9,7 +9,7 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12FILE *fopen_or_warn(const char *path, const char *mode) 12FILE* FAST_FUNC fopen_or_warn(const char *path, const char *mode)
13{ 13{
14 FILE *fp = fopen(path, mode); 14 FILE *fp = fopen(path, mode);
15 if (!fp) { 15 if (!fp) {
diff --git a/libbb/wfopen_input.c b/libbb/wfopen_input.c
index a7c1c32f5..46ff7a6de 100644
--- a/libbb/wfopen_input.c
+++ b/libbb/wfopen_input.c
@@ -14,7 +14,7 @@
14 14
15#include "libbb.h" 15#include "libbb.h"
16 16
17FILE *fopen_or_warn_stdin(const char *filename) 17FILE* FAST_FUNC fopen_or_warn_stdin(const char *filename)
18{ 18{
19 FILE *fp = stdin; 19 FILE *fp = stdin;
20 20
@@ -26,7 +26,7 @@ FILE *fopen_or_warn_stdin(const char *filename)
26 return fp; 26 return fp;
27} 27}
28 28
29FILE *xfopen_stdin(const char *filename) 29FILE* FAST_FUNC xfopen_stdin(const char *filename)
30{ 30{
31 FILE *fp = fopen_or_warn_stdin(filename); 31 FILE *fp = fopen_or_warn_stdin(filename);
32 if (fp) 32 if (fp)
@@ -34,7 +34,7 @@ FILE *xfopen_stdin(const char *filename)
34 xfunc_die(); /* We already output an error message. */ 34 xfunc_die(); /* We already output an error message. */
35} 35}
36 36
37int open_or_warn_stdin(const char *filename) 37int FAST_FUNC open_or_warn_stdin(const char *filename)
38{ 38{
39 int fd = STDIN_FILENO; 39 int fd = STDIN_FILENO;
40 40
diff --git a/libbb/write.c b/libbb/write.c
index b628b49bb..e8a9eff86 100644
--- a/libbb/write.c
+++ b/libbb/write.c
@@ -11,7 +11,7 @@
11 11
12/* Open file and write string str to it, close file. 12/* Open file and write string str to it, close file.
13 * Die on any open or write-error. */ 13 * Die on any open or write-error. */
14void xopen_xwrite_close(const char* file, const char* str) 14void FAST_FUNC xopen_xwrite_close(const char* file, const char* str)
15{ 15{
16 int fd = xopen(file, O_WRONLY); 16 int fd = xopen(file, O_WRONLY);
17 17
diff --git a/libbb/xatonum.c b/libbb/xatonum.c
index a410ae9bc..3cdf63425 100644
--- a/libbb/xatonum.c
+++ b/libbb/xatonum.c
@@ -59,12 +59,12 @@ unsigned bb_strtoui(const char *str, char **end, int b)
59 59
60/* A few special cases */ 60/* A few special cases */
61 61
62int xatoi_u(const char *numstr) 62int FAST_FUNC xatoi_u(const char *numstr)
63{ 63{
64 return xatou_range(numstr, 0, INT_MAX); 64 return xatou_range(numstr, 0, INT_MAX);
65} 65}
66 66
67uint16_t xatou16(const char *numstr) 67uint16_t FAST_FUNC xatou16(const char *numstr)
68{ 68{
69 return xatou_range(numstr, 0, 0xffff); 69 return xatou_range(numstr, 0, 0xffff);
70} 70}
diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c
index 9f9dc1102..2360ae88a 100644
--- a/libbb/xatonum_template.c
+++ b/libbb/xatonum_template.c
@@ -12,7 +12,7 @@ You need to define the following (example):
12#define XSTR_STRTOU strtoul 12#define XSTR_STRTOU strtoul
13*/ 13*/
14 14
15unsigned type xstrtou(_range_sfx)(const char *numstr, int base, 15unsigned type FAST_FUNC xstrtou(_range_sfx)(const char *numstr, int base,
16 unsigned type lower, 16 unsigned type lower,
17 unsigned type upper, 17 unsigned type upper,
18 const struct suffix_mult *suffixes) 18 const struct suffix_mult *suffixes)
@@ -71,25 +71,25 @@ unsigned type xstrtou(_range_sfx)(const char *numstr, int base,
71 bb_error_msg_and_die("invalid number '%s'", numstr); 71 bb_error_msg_and_die("invalid number '%s'", numstr);
72} 72}
73 73
74unsigned type xstrtou(_range)(const char *numstr, int base, 74unsigned type FAST_FUNC xstrtou(_range)(const char *numstr, int base,
75 unsigned type lower, 75 unsigned type lower,
76 unsigned type upper) 76 unsigned type upper)
77{ 77{
78 return xstrtou(_range_sfx)(numstr, base, lower, upper, NULL); 78 return xstrtou(_range_sfx)(numstr, base, lower, upper, NULL);
79} 79}
80 80
81unsigned type xstrtou(_sfx)(const char *numstr, int base, 81unsigned type FAST_FUNC xstrtou(_sfx)(const char *numstr, int base,
82 const struct suffix_mult *suffixes) 82 const struct suffix_mult *suffixes)
83{ 83{
84 return xstrtou(_range_sfx)(numstr, base, 0, XSTR_UTYPE_MAX, suffixes); 84 return xstrtou(_range_sfx)(numstr, base, 0, XSTR_UTYPE_MAX, suffixes);
85} 85}
86 86
87unsigned type xstrtou()(const char *numstr, int base) 87unsigned type FAST_FUNC xstrtou()(const char *numstr, int base)
88{ 88{
89 return xstrtou(_range_sfx)(numstr, base, 0, XSTR_UTYPE_MAX, NULL); 89 return xstrtou(_range_sfx)(numstr, base, 0, XSTR_UTYPE_MAX, NULL);
90} 90}
91 91
92unsigned type xatou(_range_sfx)(const char *numstr, 92unsigned type FAST_FUNC xatou(_range_sfx)(const char *numstr,
93 unsigned type lower, 93 unsigned type lower,
94 unsigned type upper, 94 unsigned type upper,
95 const struct suffix_mult *suffixes) 95 const struct suffix_mult *suffixes)
@@ -97,27 +97,27 @@ unsigned type xatou(_range_sfx)(const char *numstr,
97 return xstrtou(_range_sfx)(numstr, 10, lower, upper, suffixes); 97 return xstrtou(_range_sfx)(numstr, 10, lower, upper, suffixes);
98} 98}
99 99
100unsigned type xatou(_range)(const char *numstr, 100unsigned type FAST_FUNC xatou(_range)(const char *numstr,
101 unsigned type lower, 101 unsigned type lower,
102 unsigned type upper) 102 unsigned type upper)
103{ 103{
104 return xstrtou(_range_sfx)(numstr, 10, lower, upper, NULL); 104 return xstrtou(_range_sfx)(numstr, 10, lower, upper, NULL);
105} 105}
106 106
107unsigned type xatou(_sfx)(const char *numstr, 107unsigned type FAST_FUNC xatou(_sfx)(const char *numstr,
108 const struct suffix_mult *suffixes) 108 const struct suffix_mult *suffixes)
109{ 109{
110 return xstrtou(_range_sfx)(numstr, 10, 0, XSTR_UTYPE_MAX, suffixes); 110 return xstrtou(_range_sfx)(numstr, 10, 0, XSTR_UTYPE_MAX, suffixes);
111} 111}
112 112
113unsigned type xatou()(const char *numstr) 113unsigned type FAST_FUNC xatou()(const char *numstr)
114{ 114{
115 return xatou(_sfx)(numstr, NULL); 115 return xatou(_sfx)(numstr, NULL);
116} 116}
117 117
118/* Signed ones */ 118/* Signed ones */
119 119
120type xstrto(_range_sfx)(const char *numstr, int base, 120type FAST_FUNC xstrto(_range_sfx)(const char *numstr, int base,
121 type lower, 121 type lower,
122 type upper, 122 type upper,
123 const struct suffix_mult *suffixes) 123 const struct suffix_mult *suffixes)
@@ -148,12 +148,12 @@ type xstrto(_range_sfx)(const char *numstr, int base,
148 return r; 148 return r;
149} 149}
150 150
151type xstrto(_range)(const char *numstr, int base, type lower, type upper) 151type FAST_FUNC xstrto(_range)(const char *numstr, int base, type lower, type upper)
152{ 152{
153 return xstrto(_range_sfx)(numstr, base, lower, upper, NULL); 153 return xstrto(_range_sfx)(numstr, base, lower, upper, NULL);
154} 154}
155 155
156type xato(_range_sfx)(const char *numstr, 156type FAST_FUNC xato(_range_sfx)(const char *numstr,
157 type lower, 157 type lower,
158 type upper, 158 type upper,
159 const struct suffix_mult *suffixes) 159 const struct suffix_mult *suffixes)
@@ -161,17 +161,17 @@ type xato(_range_sfx)(const char *numstr,
161 return xstrto(_range_sfx)(numstr, 10, lower, upper, suffixes); 161 return xstrto(_range_sfx)(numstr, 10, lower, upper, suffixes);
162} 162}
163 163
164type xato(_range)(const char *numstr, type lower, type upper) 164type FAST_FUNC xato(_range)(const char *numstr, type lower, type upper)
165{ 165{
166 return xstrto(_range_sfx)(numstr, 10, lower, upper, NULL); 166 return xstrto(_range_sfx)(numstr, 10, lower, upper, NULL);
167} 167}
168 168
169type xato(_sfx)(const char *numstr, const struct suffix_mult *suffixes) 169type FAST_FUNC xato(_sfx)(const char *numstr, const struct suffix_mult *suffixes)
170{ 170{
171 return xstrto(_range_sfx)(numstr, 10, XSTR_TYPE_MIN, XSTR_TYPE_MAX, suffixes); 171 return xstrto(_range_sfx)(numstr, 10, XSTR_TYPE_MIN, XSTR_TYPE_MAX, suffixes);
172} 172}
173 173
174type xato()(const char *numstr) 174type FAST_FUNC xato()(const char *numstr)
175{ 175{
176 return xstrto(_range_sfx)(numstr, 10, XSTR_TYPE_MIN, XSTR_TYPE_MAX, NULL); 176 return xstrto(_range_sfx)(numstr, 10, XSTR_TYPE_MIN, XSTR_TYPE_MAX, NULL);
177} 177}
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index 950aee826..d48c50339 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -9,16 +9,16 @@
9#include <netinet/in.h> 9#include <netinet/in.h>
10#include "libbb.h" 10#include "libbb.h"
11 11
12void setsockopt_reuseaddr(int fd) 12void FAST_FUNC setsockopt_reuseaddr(int fd)
13{ 13{
14 setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &const_int_1, sizeof(const_int_1)); 14 setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &const_int_1, sizeof(const_int_1));
15} 15}
16int setsockopt_broadcast(int fd) 16int FAST_FUNC setsockopt_broadcast(int fd)
17{ 17{
18 return setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &const_int_1, sizeof(const_int_1)); 18 return setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &const_int_1, sizeof(const_int_1));
19} 19}
20 20
21void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) 21void FAST_FUNC xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen)
22{ 22{
23 if (connect(s, s_addr, addrlen) < 0) { 23 if (connect(s, s_addr, addrlen) < 0) {
24 if (ENABLE_FEATURE_CLEAN_UP) 24 if (ENABLE_FEATURE_CLEAN_UP)
@@ -35,7 +35,7 @@ void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen)
35 * If "port" is a number use it as the port. 35 * If "port" is a number use it as the port.
36 * If "port" is a name it is looked up in /etc/services, if it isnt found return 36 * If "port" is a name it is looked up in /etc/services, if it isnt found return
37 * default_port */ 37 * default_port */
38unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) 38unsigned FAST_FUNC bb_lookup_port(const char *port, const char *protocol, unsigned default_port)
39{ 39{
40 unsigned port_nr = default_port; 40 unsigned port_nr = default_port;
41 if (port) { 41 if (port) {
@@ -60,7 +60,7 @@ unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default
60/* "Old" networking API - only IPv4 */ 60/* "Old" networking API - only IPv4 */
61 61
62/* 62/*
63void bb_lookup_host(struct sockaddr_in *s_in, const char *host) 63void FAST_FUNC bb_lookup_host(struct sockaddr_in *s_in, const char *host)
64{ 64{
65 struct hostent *he; 65 struct hostent *he;
66 66
@@ -71,7 +71,7 @@ void bb_lookup_host(struct sockaddr_in *s_in, const char *host)
71} 71}
72 72
73 73
74int xconnect_tcp_v4(struct sockaddr_in *s_addr) 74int FAST_FUNC xconnect_tcp_v4(struct sockaddr_in *s_addr)
75{ 75{
76 int s = xsocket(AF_INET, SOCK_STREAM, 0); 76 int s = xsocket(AF_INET, SOCK_STREAM, 0);
77 xconnect(s, (struct sockaddr*) s_addr, sizeof(*s_addr)); 77 xconnect(s, (struct sockaddr*) s_addr, sizeof(*s_addr));
@@ -82,7 +82,7 @@ int xconnect_tcp_v4(struct sockaddr_in *s_addr)
82/* "New" networking API */ 82/* "New" networking API */
83 83
84 84
85int get_nport(const struct sockaddr *sa) 85int FAST_FUNC get_nport(const struct sockaddr *sa)
86{ 86{
87#if ENABLE_FEATURE_IPV6 87#if ENABLE_FEATURE_IPV6
88 if (sa->sa_family == AF_INET6) { 88 if (sa->sa_family == AF_INET6) {
@@ -96,7 +96,7 @@ int get_nport(const struct sockaddr *sa)
96 return -1; 96 return -1;
97} 97}
98 98
99void set_nport(len_and_sockaddr *lsa, unsigned port) 99void FAST_FUNC set_nport(len_and_sockaddr *lsa, unsigned port)
100{ 100{
101#if ENABLE_FEATURE_IPV6 101#if ENABLE_FEATURE_IPV6
102 if (lsa->u.sa.sa_family == AF_INET6) { 102 if (lsa->u.sa.sa_family == AF_INET6) {
@@ -205,34 +205,34 @@ USE_FEATURE_IPV6(sa_family_t af,)
205#endif 205#endif
206 206
207#if ENABLE_FEATURE_IPV6 207#if ENABLE_FEATURE_IPV6
208len_and_sockaddr* host_and_af2sockaddr(const char *host, int port, sa_family_t af) 208len_and_sockaddr* FAST_FUNC host_and_af2sockaddr(const char *host, int port, sa_family_t af)
209{ 209{
210 return str2sockaddr(host, port, af, 0); 210 return str2sockaddr(host, port, af, 0);
211} 211}
212 212
213len_and_sockaddr* xhost_and_af2sockaddr(const char *host, int port, sa_family_t af) 213len_and_sockaddr* FAST_FUNC xhost_and_af2sockaddr(const char *host, int port, sa_family_t af)
214{ 214{
215 return str2sockaddr(host, port, af, DIE_ON_ERROR); 215 return str2sockaddr(host, port, af, DIE_ON_ERROR);
216} 216}
217#endif 217#endif
218 218
219len_and_sockaddr* host2sockaddr(const char *host, int port) 219len_and_sockaddr* FAST_FUNC host2sockaddr(const char *host, int port)
220{ 220{
221 return str2sockaddr(host, port, AF_UNSPEC, 0); 221 return str2sockaddr(host, port, AF_UNSPEC, 0);
222} 222}
223 223
224len_and_sockaddr* xhost2sockaddr(const char *host, int port) 224len_and_sockaddr* FAST_FUNC xhost2sockaddr(const char *host, int port)
225{ 225{
226 return str2sockaddr(host, port, AF_UNSPEC, DIE_ON_ERROR); 226 return str2sockaddr(host, port, AF_UNSPEC, DIE_ON_ERROR);
227} 227}
228 228
229len_and_sockaddr* xdotted2sockaddr(const char *host, int port) 229len_and_sockaddr* FAST_FUNC xdotted2sockaddr(const char *host, int port)
230{ 230{
231 return str2sockaddr(host, port, AF_UNSPEC, AI_NUMERICHOST | DIE_ON_ERROR); 231 return str2sockaddr(host, port, AF_UNSPEC, AI_NUMERICHOST | DIE_ON_ERROR);
232} 232}
233 233
234#undef xsocket_type 234#undef xsocket_type
235int xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int family,) int sock_type) 235int FAST_FUNC xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int family,) int sock_type)
236{ 236{
237 SKIP_FEATURE_IPV6(enum { family = AF_INET };) 237 SKIP_FEATURE_IPV6(enum { family = AF_INET };)
238 len_and_sockaddr *lsa; 238 len_and_sockaddr *lsa;
@@ -264,7 +264,7 @@ int xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int family,) int sock
264 return fd; 264 return fd;
265} 265}
266 266
267int xsocket_stream(len_and_sockaddr **lsap) 267int FAST_FUNC xsocket_stream(len_and_sockaddr **lsap)
268{ 268{
269 return xsocket_type(lsap, USE_FEATURE_IPV6(AF_UNSPEC,) SOCK_STREAM); 269 return xsocket_type(lsap, USE_FEATURE_IPV6(AF_UNSPEC,) SOCK_STREAM);
270} 270}
@@ -288,18 +288,18 @@ static int create_and_bind_or_die(const char *bindaddr, int port, int sock_type)
288 return fd; 288 return fd;
289} 289}
290 290
291int create_and_bind_stream_or_die(const char *bindaddr, int port) 291int FAST_FUNC create_and_bind_stream_or_die(const char *bindaddr, int port)
292{ 292{
293 return create_and_bind_or_die(bindaddr, port, SOCK_STREAM); 293 return create_and_bind_or_die(bindaddr, port, SOCK_STREAM);
294} 294}
295 295
296int create_and_bind_dgram_or_die(const char *bindaddr, int port) 296int FAST_FUNC create_and_bind_dgram_or_die(const char *bindaddr, int port)
297{ 297{
298 return create_and_bind_or_die(bindaddr, port, SOCK_DGRAM); 298 return create_and_bind_or_die(bindaddr, port, SOCK_DGRAM);
299} 299}
300 300
301 301
302int create_and_connect_stream_or_die(const char *peer, int port) 302int FAST_FUNC create_and_connect_stream_or_die(const char *peer, int port)
303{ 303{
304 int fd; 304 int fd;
305 len_and_sockaddr *lsa; 305 len_and_sockaddr *lsa;
@@ -312,7 +312,7 @@ int create_and_connect_stream_or_die(const char *peer, int port)
312 return fd; 312 return fd;
313} 313}
314 314
315int xconnect_stream(const len_and_sockaddr *lsa) 315int FAST_FUNC xconnect_stream(const len_and_sockaddr *lsa)
316{ 316{
317 int fd = xsocket(lsa->u.sa.sa_family, SOCK_STREAM, 0); 317 int fd = xsocket(lsa->u.sa.sa_family, SOCK_STREAM, 0);
318 xconnect(fd, &lsa->u.sa, lsa->len); 318 xconnect(fd, &lsa->u.sa, lsa->len);
@@ -322,7 +322,7 @@ int xconnect_stream(const len_and_sockaddr *lsa)
322/* We hijack this constant to mean something else */ 322/* We hijack this constant to mean something else */
323/* It doesn't hurt because we will add this bit anyway */ 323/* It doesn't hurt because we will add this bit anyway */
324#define IGNORE_PORT NI_NUMERICSERV 324#define IGNORE_PORT NI_NUMERICSERV
325static char* sockaddr2str(const struct sockaddr *sa, int flags) 325static char* FAST_FUNC sockaddr2str(const struct sockaddr *sa, int flags)
326{ 326{
327 char host[128]; 327 char host[128];
328 char serv[16]; 328 char serv[16];
@@ -361,26 +361,26 @@ static char* sockaddr2str(const struct sockaddr *sa, int flags)
361 /*return xstrdup(host);*/ 361 /*return xstrdup(host);*/
362} 362}
363 363
364char* xmalloc_sockaddr2host(const struct sockaddr *sa) 364char* FAST_FUNC xmalloc_sockaddr2host(const struct sockaddr *sa)
365{ 365{
366 return sockaddr2str(sa, 0); 366 return sockaddr2str(sa, 0);
367} 367}
368 368
369char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa) 369char* FAST_FUNC xmalloc_sockaddr2host_noport(const struct sockaddr *sa)
370{ 370{
371 return sockaddr2str(sa, IGNORE_PORT); 371 return sockaddr2str(sa, IGNORE_PORT);
372} 372}
373 373
374char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa) 374char* FAST_FUNC xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa)
375{ 375{
376 return sockaddr2str(sa, NI_NAMEREQD | IGNORE_PORT); 376 return sockaddr2str(sa, NI_NAMEREQD | IGNORE_PORT);
377} 377}
378char* xmalloc_sockaddr2dotted(const struct sockaddr *sa) 378char* FAST_FUNC xmalloc_sockaddr2dotted(const struct sockaddr *sa)
379{ 379{
380 return sockaddr2str(sa, NI_NUMERICHOST); 380 return sockaddr2str(sa, NI_NUMERICHOST);
381} 381}
382 382
383char* xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa) 383char* FAST_FUNC xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa)
384{ 384{
385 return sockaddr2str(sa, NI_NUMERICHOST | IGNORE_PORT); 385 return sockaddr2str(sa, NI_NUMERICHOST | IGNORE_PORT);
386} 386}
diff --git a/libbb/xfunc_die.c b/libbb/xfunc_die.c
index 357494d34..ba9fe935a 100644
--- a/libbb/xfunc_die.c
+++ b/libbb/xfunc_die.c
@@ -17,7 +17,7 @@ int die_sleep;
17jmp_buf die_jmp; 17jmp_buf die_jmp;
18#endif 18#endif
19 19
20void xfunc_die(void) 20void FAST_FUNC xfunc_die(void)
21{ 21{
22 if (die_sleep) { 22 if (die_sleep) {
23 if ((ENABLE_FEATURE_PREFER_APPLETS || ENABLE_HUSH) 23 if ((ENABLE_FEATURE_PREFER_APPLETS || ENABLE_HUSH)
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index fe3c647d0..8ef305ba0 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -25,17 +25,17 @@
25#include "libbb.h" 25#include "libbb.h"
26 26
27/* Turn on nonblocking I/O on a fd */ 27/* Turn on nonblocking I/O on a fd */
28int ndelay_on(int fd) 28int FAST_FUNC ndelay_on(int fd)
29{ 29{
30 return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) | O_NONBLOCK); 30 return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) | O_NONBLOCK);
31} 31}
32 32
33int ndelay_off(int fd) 33int FAST_FUNC ndelay_off(int fd)
34{ 34{
35 return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) & ~O_NONBLOCK); 35 return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) & ~O_NONBLOCK);
36} 36}
37 37
38int close_on_exec_on(int fd) 38int FAST_FUNC close_on_exec_on(int fd)
39{ 39{
40 return fcntl(fd, F_SETFD, FD_CLOEXEC); 40 return fcntl(fd, F_SETFD, FD_CLOEXEC);
41} 41}
@@ -43,7 +43,7 @@ int close_on_exec_on(int fd)
43/* Convert unsigned long long value into compact 4-char 43/* Convert unsigned long long value into compact 4-char
44 * representation. Examples: "1234", "1.2k", " 27M", "123T" 44 * representation. Examples: "1234", "1.2k", " 27M", "123T"
45 * String is not terminated (buf[4] is untouched) */ 45 * String is not terminated (buf[4] is untouched) */
46void smart_ulltoa4(unsigned long long ul, char buf[5], const char *scale) 46void FAST_FUNC smart_ulltoa4(unsigned long long ul, char buf[5], const char *scale)
47{ 47{
48 const char *fmt; 48 const char *fmt;
49 char c; 49 char c;
@@ -91,7 +91,7 @@ void smart_ulltoa4(unsigned long long ul, char buf[5], const char *scale)
91 91
92/* Convert unsigned long long value into compact 5-char representation. 92/* Convert unsigned long long value into compact 5-char representation.
93 * String is not terminated (buf[5] is untouched) */ 93 * String is not terminated (buf[5] is untouched) */
94void smart_ulltoa5(unsigned long long ul, char buf[6], const char *scale) 94void FAST_FUNC smart_ulltoa5(unsigned long long ul, char buf[6], const char *scale)
95{ 95{
96 const char *fmt; 96 const char *fmt;
97 char c; 97 char c;
@@ -149,7 +149,7 @@ void smart_ulltoa5(unsigned long long ul, char buf[6], const char *scale)
149// A truncated result contains the first few digits of the result ala strncpy. 149// A truncated result contains the first few digits of the result ala strncpy.
150// Returns a pointer past last generated digit, does _not_ store NUL. 150// Returns a pointer past last generated digit, does _not_ store NUL.
151void BUG_sizeof_unsigned_not_4(void); 151void BUG_sizeof_unsigned_not_4(void);
152char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) 152char* FAST_FUNC utoa_to_buf(unsigned n, char *buf, unsigned buflen)
153{ 153{
154 unsigned i, out, res; 154 unsigned i, out, res;
155 if (sizeof(unsigned) != 4) 155 if (sizeof(unsigned) != 4)
@@ -170,7 +170,7 @@ char *utoa_to_buf(unsigned n, char *buf, unsigned buflen)
170} 170}
171 171
172/* Convert signed integer to ascii, like utoa_to_buf() */ 172/* Convert signed integer to ascii, like utoa_to_buf() */
173char *itoa_to_buf(int n, char *buf, unsigned buflen) 173char* FAST_FUNC itoa_to_buf(int n, char *buf, unsigned buflen)
174{ 174{
175 if (buflen && n < 0) { 175 if (buflen && n < 0) {
176 n = -n; 176 n = -n;
@@ -190,7 +190,7 @@ char *itoa_to_buf(int n, char *buf, unsigned buflen)
190static char local_buf[sizeof(int) * 3]; 190static char local_buf[sizeof(int) * 3];
191 191
192// Convert unsigned integer to ascii using a static buffer (returned). 192// Convert unsigned integer to ascii using a static buffer (returned).
193char *utoa(unsigned n) 193char* FAST_FUNC utoa(unsigned n)
194{ 194{
195 *(utoa_to_buf(n, local_buf, sizeof(local_buf))) = '\0'; 195 *(utoa_to_buf(n, local_buf, sizeof(local_buf))) = '\0';
196 196
@@ -198,7 +198,7 @@ char *utoa(unsigned n)
198} 198}
199 199
200/* Convert signed integer to ascii using a static buffer (returned). */ 200/* Convert signed integer to ascii using a static buffer (returned). */
201char *itoa(int n) 201char* FAST_FUNC itoa(int n)
202{ 202{
203 *(itoa_to_buf(n, local_buf, sizeof(local_buf))) = '\0'; 203 *(itoa_to_buf(n, local_buf, sizeof(local_buf))) = '\0';
204 204
@@ -206,7 +206,7 @@ char *itoa(int n)
206} 206}
207 207
208/* Emit a string of hex representation of bytes */ 208/* Emit a string of hex representation of bytes */
209char *bin2hex(char *p, const char *cp, int count) 209char* FAST_FUNC bin2hex(char *p, const char *cp, int count)
210{ 210{
211 while (count) { 211 while (count) {
212 unsigned char c = *cp++; 212 unsigned char c = *cp++;
@@ -220,7 +220,7 @@ char *bin2hex(char *p, const char *cp, int count)
220 220
221/* Return how long the file at fd is, if there's any way to determine it. */ 221/* Return how long the file at fd is, if there's any way to determine it. */
222#ifdef UNUSED 222#ifdef UNUSED
223off_t fdlength(int fd) 223off_t FAST_FUNC fdlength(int fd)
224{ 224{
225 off_t bottom = 0, top = 0, pos; 225 off_t bottom = 0, top = 0, pos;
226 long size; 226 long size;
@@ -262,7 +262,7 @@ off_t fdlength(int fd)
262 262
263/* It is perfectly ok to pass in a NULL for either width or for 263/* It is perfectly ok to pass in a NULL for either width or for
264 * height, in which case that value will not be set. */ 264 * height, in which case that value will not be set. */
265int get_terminal_width_height(int fd, unsigned *width, unsigned *height) 265int FAST_FUNC get_terminal_width_height(int fd, unsigned *width, unsigned *height)
266{ 266{
267 struct winsize win = { 0, 0, 0, 0 }; 267 struct winsize win = { 0, 0, 0, 0 };
268 int ret = ioctl(fd, TIOCGWINSZ, &win); 268 int ret = ioctl(fd, TIOCGWINSZ, &win);
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index 105939b5e..108e14043 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -33,7 +33,7 @@
33 * included after these prototypes in libbb.h, all is well. 33 * included after these prototypes in libbb.h, all is well.
34 */ 34 */
35// Warn if we can't allocate size bytes of memory. 35// Warn if we can't allocate size bytes of memory.
36void *malloc_or_warn(size_t size) 36void* FAST_FUNC malloc_or_warn(size_t size)
37{ 37{
38 void *ptr = malloc(size); 38 void *ptr = malloc(size);
39 if (ptr == NULL && size != 0) 39 if (ptr == NULL && size != 0)
@@ -42,7 +42,7 @@ void *malloc_or_warn(size_t size)
42} 42}
43 43
44// Die if we can't allocate size bytes of memory. 44// Die if we can't allocate size bytes of memory.
45void *xmalloc(size_t size) 45void* FAST_FUNC xmalloc(size_t size)
46{ 46{
47 void *ptr = malloc(size); 47 void *ptr = malloc(size);
48 if (ptr == NULL && size != 0) 48 if (ptr == NULL && size != 0)
@@ -53,7 +53,7 @@ void *xmalloc(size_t size)
53// Die if we can't resize previously allocated memory. (This returns a pointer 53// Die if we can't resize previously allocated memory. (This returns a pointer
54// to the new memory, which may or may not be the same as the old memory. 54// to the new memory, which may or may not be the same as the old memory.
55// It'll copy the contents to a new chunk and free the old one if necessary.) 55// It'll copy the contents to a new chunk and free the old one if necessary.)
56void *xrealloc(void *ptr, size_t size) 56void* FAST_FUNC xrealloc(void *ptr, size_t size)
57{ 57{
58 ptr = realloc(ptr, size); 58 ptr = realloc(ptr, size);
59 if (ptr == NULL && size != 0) 59 if (ptr == NULL && size != 0)
@@ -63,7 +63,7 @@ void *xrealloc(void *ptr, size_t size)
63#endif /* DMALLOC */ 63#endif /* DMALLOC */
64 64
65// Die if we can't allocate and zero size bytes of memory. 65// Die if we can't allocate and zero size bytes of memory.
66void *xzalloc(size_t size) 66void* FAST_FUNC xzalloc(size_t size)
67{ 67{
68 void *ptr = xmalloc(size); 68 void *ptr = xmalloc(size);
69 memset(ptr, 0, size); 69 memset(ptr, 0, size);
@@ -71,7 +71,7 @@ void *xzalloc(size_t size)
71} 71}
72 72
73// Die if we can't copy a string to freshly allocated memory. 73// Die if we can't copy a string to freshly allocated memory.
74char * xstrdup(const char *s) 74char* FAST_FUNC xstrdup(const char *s)
75{ 75{
76 char *t; 76 char *t;
77 77
@@ -88,7 +88,7 @@ char * xstrdup(const char *s)
88 88
89// Die if we can't allocate n+1 bytes (space for the null terminator) and copy 89// Die if we can't allocate n+1 bytes (space for the null terminator) and copy
90// the (possibly truncated to length n) string into it. 90// the (possibly truncated to length n) string into it.
91char *xstrndup(const char *s, int n) 91char* FAST_FUNC xstrndup(const char *s, int n)
92{ 92{
93 int m; 93 int m;
94 char *t; 94 char *t;
@@ -112,9 +112,9 @@ char *xstrndup(const char *s, int n)
112 return memcpy(t, s, n); 112 return memcpy(t, s, n);
113} 113}
114 114
115// Die if we can't open a file and return a FILE * to it. 115// Die if we can't open a file and return a FILE* to it.
116// Notice we haven't got xfread(), This is for use with fscanf() and friends. 116// Notice we haven't got xfread(), This is for use with fscanf() and friends.
117FILE *xfopen(const char *path, const char *mode) 117FILE* FAST_FUNC xfopen(const char *path, const char *mode)
118{ 118{
119 FILE *fp = fopen(path, mode); 119 FILE *fp = fopen(path, mode);
120 if (fp == NULL) 120 if (fp == NULL)
@@ -123,7 +123,7 @@ FILE *xfopen(const char *path, const char *mode)
123} 123}
124 124
125// Die if we can't open a file and return a fd. 125// Die if we can't open a file and return a fd.
126int xopen3(const char *pathname, int flags, int mode) 126int FAST_FUNC xopen3(const char *pathname, int flags, int mode)
127{ 127{
128 int ret; 128 int ret;
129 129
@@ -135,13 +135,13 @@ int xopen3(const char *pathname, int flags, int mode)
135} 135}
136 136
137// Die if we can't open an existing file and return a fd. 137// Die if we can't open an existing file and return a fd.
138int xopen(const char *pathname, int flags) 138int FAST_FUNC xopen(const char *pathname, int flags)
139{ 139{
140 return xopen3(pathname, flags, 0666); 140 return xopen3(pathname, flags, 0666);
141} 141}
142 142
143// Warn if we can't open a file and return a fd. 143// Warn if we can't open a file and return a fd.
144int open3_or_warn(const char *pathname, int flags, int mode) 144int FAST_FUNC open3_or_warn(const char *pathname, int flags, int mode)
145{ 145{
146 int ret; 146 int ret;
147 147
@@ -153,24 +153,24 @@ int open3_or_warn(const char *pathname, int flags, int mode)
153} 153}
154 154
155// Warn if we can't open a file and return a fd. 155// Warn if we can't open a file and return a fd.
156int open_or_warn(const char *pathname, int flags) 156int FAST_FUNC open_or_warn(const char *pathname, int flags)
157{ 157{
158 return open3_or_warn(pathname, flags, 0666); 158 return open3_or_warn(pathname, flags, 0666);
159} 159}
160 160
161void xunlink(const char *pathname) 161void FAST_FUNC xunlink(const char *pathname)
162{ 162{
163 if (unlink(pathname)) 163 if (unlink(pathname))
164 bb_perror_msg_and_die("can't remove file '%s'", pathname); 164 bb_perror_msg_and_die("can't remove file '%s'", pathname);
165} 165}
166 166
167void xrename(const char *oldpath, const char *newpath) 167void FAST_FUNC xrename(const char *oldpath, const char *newpath)
168{ 168{
169 if (rename(oldpath, newpath)) 169 if (rename(oldpath, newpath))
170 bb_perror_msg_and_die("can't move '%s' to '%s'", oldpath, newpath); 170 bb_perror_msg_and_die("can't move '%s' to '%s'", oldpath, newpath);
171} 171}
172 172
173int rename_or_warn(const char *oldpath, const char *newpath) 173int FAST_FUNC rename_or_warn(const char *oldpath, const char *newpath)
174{ 174{
175 int n = rename(oldpath, newpath); 175 int n = rename(oldpath, newpath);
176 if (n) 176 if (n)
@@ -178,20 +178,20 @@ int rename_or_warn(const char *oldpath, const char *newpath)
178 return n; 178 return n;
179} 179}
180 180
181void xpipe(int filedes[2]) 181void FAST_FUNC xpipe(int filedes[2])
182{ 182{
183 if (pipe(filedes)) 183 if (pipe(filedes))
184 bb_perror_msg_and_die("can't create pipe"); 184 bb_perror_msg_and_die("can't create pipe");
185} 185}
186 186
187void xdup2(int from, int to) 187void FAST_FUNC xdup2(int from, int to)
188{ 188{
189 if (dup2(from, to) != to) 189 if (dup2(from, to) != to)
190 bb_perror_msg_and_die("can't duplicate file descriptor"); 190 bb_perror_msg_and_die("can't duplicate file descriptor");
191} 191}
192 192
193// "Renumber" opened fd 193// "Renumber" opened fd
194void xmove_fd(int from, int to) 194void FAST_FUNC xmove_fd(int from, int to)
195{ 195{
196 if (from == to) 196 if (from == to)
197 return; 197 return;
@@ -200,7 +200,7 @@ void xmove_fd(int from, int to)
200} 200}
201 201
202// Die with an error message if we can't write the entire buffer. 202// Die with an error message if we can't write the entire buffer.
203void xwrite(int fd, const void *buf, size_t count) 203void FAST_FUNC xwrite(int fd, const void *buf, size_t count)
204{ 204{
205 if (count) { 205 if (count) {
206 ssize_t size = full_write(fd, buf, count); 206 ssize_t size = full_write(fd, buf, count);
@@ -210,7 +210,7 @@ void xwrite(int fd, const void *buf, size_t count)
210} 210}
211 211
212// Die with an error message if we can't lseek to the right spot. 212// Die with an error message if we can't lseek to the right spot.
213off_t xlseek(int fd, off_t offset, int whence) 213off_t FAST_FUNC xlseek(int fd, off_t offset, int whence)
214{ 214{
215 off_t off = lseek(fd, offset, whence); 215 off_t off = lseek(fd, offset, whence);
216 if (off == (off_t)-1) { 216 if (off == (off_t)-1) {
@@ -221,8 +221,8 @@ off_t xlseek(int fd, off_t offset, int whence)
221 return off; 221 return off;
222} 222}
223 223
224// Die with supplied filename if this FILE * has ferror set. 224// Die with supplied filename if this FILE* has ferror set.
225void die_if_ferror(FILE *fp, const char *fn) 225void FAST_FUNC die_if_ferror(FILE *fp, const char *fn)
226{ 226{
227 if (ferror(fp)) { 227 if (ferror(fp)) {
228 /* ferror doesn't set useful errno */ 228 /* ferror doesn't set useful errno */
@@ -231,13 +231,13 @@ void die_if_ferror(FILE *fp, const char *fn)
231} 231}
232 232
233// Die with an error message if stdout has ferror set. 233// Die with an error message if stdout has ferror set.
234void die_if_ferror_stdout(void) 234void FAST_FUNC die_if_ferror_stdout(void)
235{ 235{
236 die_if_ferror(stdout, bb_msg_standard_output); 236 die_if_ferror(stdout, bb_msg_standard_output);
237} 237}
238 238
239// Die with an error message if we have trouble flushing stdout. 239// Die with an error message if we have trouble flushing stdout.
240void xfflush_stdout(void) 240void FAST_FUNC xfflush_stdout(void)
241{ 241{
242 if (fflush(stdout)) { 242 if (fflush(stdout)) {
243 bb_perror_msg_and_die(bb_msg_standard_output); 243 bb_perror_msg_and_die(bb_msg_standard_output);
@@ -245,7 +245,7 @@ void xfflush_stdout(void)
245} 245}
246 246
247 247
248int bb_putchar(int ch) 248int FAST_FUNC bb_putchar(int ch)
249{ 249{
250 /* time.c needs putc(ch, stdout), not putchar(ch). 250 /* time.c needs putc(ch, stdout), not putchar(ch).
251 * it does "stdout = stderr;", but then glibc's putchar() 251 * it does "stdout = stderr;", but then glibc's putchar()
@@ -253,9 +253,9 @@ int bb_putchar(int ch)
253 return putc(ch, stdout); 253 return putc(ch, stdout);
254} 254}
255 255
256/* Die with an error message if we can't copy an entire FILE * to stdout, 256/* Die with an error message if we can't copy an entire FILE* to stdout,
257 * then close that file. */ 257 * then close that file. */
258void xprint_and_close_file(FILE *file) 258void FAST_FUNC xprint_and_close_file(FILE *file)
259{ 259{
260 fflush(stdout); 260 fflush(stdout);
261 // copyfd outputs error messages for us. 261 // copyfd outputs error messages for us.
@@ -267,7 +267,7 @@ void xprint_and_close_file(FILE *file)
267 267
268// Die with an error message if we can't malloc() enough space and do an 268// Die with an error message if we can't malloc() enough space and do an
269// sprintf() into that space. 269// sprintf() into that space.
270char *xasprintf(const char *format, ...) 270char* FAST_FUNC xasprintf(const char *format, ...)
271{ 271{
272 va_list p; 272 va_list p;
273 int r; 273 int r;
@@ -295,7 +295,7 @@ char *xasprintf(const char *format, ...)
295} 295}
296 296
297#if 0 /* If we will ever meet a libc which hasn't [f]dprintf... */ 297#if 0 /* If we will ever meet a libc which hasn't [f]dprintf... */
298int fdprintf(int fd, const char *format, ...) 298int FAST_FUNC fdprintf(int fd, const char *format, ...)
299{ 299{
300 va_list p; 300 va_list p;
301 int r; 301 int r;
@@ -327,7 +327,7 @@ int fdprintf(int fd, const char *format, ...)
327} 327}
328#endif 328#endif
329 329
330void xsetenv(const char *key, const char *value) 330void FAST_FUNC xsetenv(const char *key, const char *value)
331{ 331{
332 if (setenv(key, value, 1)) 332 if (setenv(key, value, 1))
333 bb_error_msg_and_die(bb_msg_memory_exhausted); 333 bb_error_msg_and_die(bb_msg_memory_exhausted);
@@ -336,32 +336,32 @@ void xsetenv(const char *key, const char *value)
336// Die with an error message if we can't set gid. (Because resource limits may 336// Die with an error message if we can't set gid. (Because resource limits may
337// limit this user to a given number of processes, and if that fills up the 337// limit this user to a given number of processes, and if that fills up the
338// setgid() will fail and we'll _still_be_root_, which is bad.) 338// setgid() will fail and we'll _still_be_root_, which is bad.)
339void xsetgid(gid_t gid) 339void FAST_FUNC xsetgid(gid_t gid)
340{ 340{
341 if (setgid(gid)) bb_perror_msg_and_die("setgid"); 341 if (setgid(gid)) bb_perror_msg_and_die("setgid");
342} 342}
343 343
344// Die with an error message if we can't set uid. (See xsetgid() for why.) 344// Die with an error message if we can't set uid. (See xsetgid() for why.)
345void xsetuid(uid_t uid) 345void FAST_FUNC xsetuid(uid_t uid)
346{ 346{
347 if (setuid(uid)) bb_perror_msg_and_die("setuid"); 347 if (setuid(uid)) bb_perror_msg_and_die("setuid");
348} 348}
349 349
350// Die if we can't chdir to a new path. 350// Die if we can't chdir to a new path.
351void xchdir(const char *path) 351void FAST_FUNC xchdir(const char *path)
352{ 352{
353 if (chdir(path)) 353 if (chdir(path))
354 bb_perror_msg_and_die("chdir(%s)", path); 354 bb_perror_msg_and_die("chdir(%s)", path);
355} 355}
356 356
357void xchroot(const char *path) 357void FAST_FUNC xchroot(const char *path)
358{ 358{
359 if (chroot(path)) 359 if (chroot(path))
360 bb_perror_msg_and_die("can't change root directory to %s", path); 360 bb_perror_msg_and_die("can't change root directory to %s", path);
361} 361}
362 362
363// Print a warning message if opendir() fails, but don't die. 363// Print a warning message if opendir() fails, but don't die.
364DIR *warn_opendir(const char *path) 364DIR* FAST_FUNC warn_opendir(const char *path)
365{ 365{
366 DIR *dp; 366 DIR *dp;
367 367
@@ -372,7 +372,7 @@ DIR *warn_opendir(const char *path)
372} 372}
373 373
374// Die with an error message if opendir() fails. 374// Die with an error message if opendir() fails.
375DIR *xopendir(const char *path) 375DIR* FAST_FUNC xopendir(const char *path)
376{ 376{
377 DIR *dp; 377 DIR *dp;
378 378
@@ -383,7 +383,7 @@ DIR *xopendir(const char *path)
383} 383}
384 384
385// Die with an error message if we can't open a new socket. 385// Die with an error message if we can't open a new socket.
386int xsocket(int domain, int type, int protocol) 386int FAST_FUNC xsocket(int domain, int type, int protocol)
387{ 387{
388 int r = socket(domain, type, protocol); 388 int r = socket(domain, type, protocol);
389 389
@@ -404,20 +404,20 @@ USE_FEATURE_IPV6(if (domain == AF_INET6) s = "INET6";)
404} 404}
405 405
406// Die with an error message if we can't bind a socket to an address. 406// Die with an error message if we can't bind a socket to an address.
407void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen) 407void FAST_FUNC xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen)
408{ 408{
409 if (bind(sockfd, my_addr, addrlen)) bb_perror_msg_and_die("bind"); 409 if (bind(sockfd, my_addr, addrlen)) bb_perror_msg_and_die("bind");
410} 410}
411 411
412// Die with an error message if we can't listen for connections on a socket. 412// Die with an error message if we can't listen for connections on a socket.
413void xlisten(int s, int backlog) 413void FAST_FUNC xlisten(int s, int backlog)
414{ 414{
415 if (listen(s, backlog)) bb_perror_msg_and_die("listen"); 415 if (listen(s, backlog)) bb_perror_msg_and_die("listen");
416} 416}
417 417
418/* Die with an error message if sendto failed. 418/* Die with an error message if sendto failed.
419 * Return bytes sent otherwise */ 419 * Return bytes sent otherwise */
420ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, 420ssize_t FAST_FUNC xsendto(int s, const void *buf, size_t len, const struct sockaddr *to,
421 socklen_t tolen) 421 socklen_t tolen)
422{ 422{
423 ssize_t ret = sendto(s, buf, len, 0, to, tolen); 423 ssize_t ret = sendto(s, buf, len, 0, to, tolen);
@@ -430,14 +430,14 @@ ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to,
430} 430}
431 431
432// xstat() - a stat() which dies on failure with meaningful error message 432// xstat() - a stat() which dies on failure with meaningful error message
433void xstat(const char *name, struct stat *stat_buf) 433void FAST_FUNC xstat(const char *name, struct stat *stat_buf)
434{ 434{
435 if (stat(name, stat_buf)) 435 if (stat(name, stat_buf))
436 bb_perror_msg_and_die("can't stat '%s'", name); 436 bb_perror_msg_and_die("can't stat '%s'", name);
437} 437}
438 438
439// selinux_or_die() - die if SELinux is disabled. 439// selinux_or_die() - die if SELinux is disabled.
440void selinux_or_die(void) 440void FAST_FUNC selinux_or_die(void)
441{ 441{
442#if ENABLE_SELINUX 442#if ENABLE_SELINUX
443 int rc = is_selinux_enabled(); 443 int rc = is_selinux_enabled();
@@ -451,7 +451,7 @@ void selinux_or_die(void)
451#endif 451#endif
452} 452}
453 453
454int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) 454int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...)
455{ 455{
456 int ret; 456 int ret;
457 va_list p; 457 va_list p;
@@ -467,7 +467,7 @@ int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fm
467 return ret; 467 return ret;
468} 468}
469 469
470int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) 470int FAST_FUNC ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...)
471{ 471{
472 va_list p; 472 va_list p;
473 int ret = ioctl(fd, request, argp); 473 int ret = ioctl(fd, request, argp);
@@ -481,7 +481,7 @@ int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...)
481} 481}
482 482
483#if ENABLE_IOCTL_HEX2STR_ERROR 483#if ENABLE_IOCTL_HEX2STR_ERROR
484int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name) 484int FAST_FUNC bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name)
485{ 485{
486 int ret; 486 int ret;
487 487
@@ -490,7 +490,7 @@ int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_nam
490 bb_simple_perror_msg(ioctl_name); 490 bb_simple_perror_msg(ioctl_name);
491 return ret; 491 return ret;
492} 492}
493int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name) 493int FAST_FUNC bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name)
494{ 494{
495 int ret; 495 int ret;
496 496
@@ -500,7 +500,7 @@ int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name)
500 return ret; 500 return ret;
501} 501}
502#else 502#else
503int bb_ioctl_or_warn(int fd, unsigned request, void *argp) 503int FAST_FUNC bb_ioctl_or_warn(int fd, unsigned request, void *argp)
504{ 504{
505 int ret; 505 int ret;
506 506
@@ -509,7 +509,7 @@ int bb_ioctl_or_warn(int fd, unsigned request, void *argp)
509 bb_perror_msg("ioctl %#x failed", request); 509 bb_perror_msg("ioctl %#x failed", request);
510 return ret; 510 return ret;
511} 511}
512int bb_xioctl(int fd, unsigned request, void *argp) 512int FAST_FUNC bb_xioctl(int fd, unsigned request, void *argp)
513{ 513{
514 int ret; 514 int ret;
515 515
diff --git a/libbb/xgetcwd.c b/libbb/xgetcwd.c
index c194e2303..eefe1d660 100644
--- a/libbb/xgetcwd.c
+++ b/libbb/xgetcwd.c
@@ -14,7 +14,7 @@
14 If argument is not NULL (previous usage allocate memory), call free() 14 If argument is not NULL (previous usage allocate memory), call free()
15*/ 15*/
16 16
17char * 17char* FAST_FUNC
18xrealloc_getcwd_or_warn(char *cwd) 18xrealloc_getcwd_or_warn(char *cwd)
19{ 19{
20#define PATH_INCR 64 20#define PATH_INCR 64
diff --git a/libbb/xgethostbyname.c b/libbb/xgethostbyname.c
index 3bb522d80..f1839f7e6 100644
--- a/libbb/xgethostbyname.c
+++ b/libbb/xgethostbyname.c
@@ -10,7 +10,7 @@
10//#include <netdb.h> 10//#include <netdb.h>
11#include "libbb.h" 11#include "libbb.h"
12 12
13struct hostent *xgethostbyname(const char *name) 13struct hostent* FAST_FUNC xgethostbyname(const char *name)
14{ 14{
15 struct hostent *retval = gethostbyname(name); 15 struct hostent *retval = gethostbyname(name);
16 if (!retval) 16 if (!retval)
diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c
index 0b961b6f9..2cfc5751c 100644
--- a/libbb/xreadlink.c
+++ b/libbb/xreadlink.c
@@ -10,7 +10,7 @@
10 * NOTE: This function returns a malloced char* that you will have to free 10 * NOTE: This function returns a malloced char* that you will have to free
11 * yourself. 11 * yourself.
12 */ 12 */
13char *xmalloc_readlink(const char *path) 13char* FAST_FUNC xmalloc_readlink(const char *path)
14{ 14{
15 enum { GROWBY = 80 }; /* how large we will grow strings by */ 15 enum { GROWBY = 80 }; /* how large we will grow strings by */
16 16
@@ -42,7 +42,7 @@ char *xmalloc_readlink(const char *path)
42 * those at the tail. 42 * those at the tail.
43 * A malloced char* is returned, which must be freed by the caller. 43 * A malloced char* is returned, which must be freed by the caller.
44 */ 44 */
45char *xmalloc_follow_symlinks(const char *path) 45char* FAST_FUNC xmalloc_follow_symlinks(const char *path)
46{ 46{
47 char *buf; 47 char *buf;
48 char *lpc; 48 char *lpc;
@@ -84,7 +84,7 @@ char *xmalloc_follow_symlinks(const char *path)
84 } 84 }
85} 85}
86 86
87char *xmalloc_readlink_or_warn(const char *path) 87char* FAST_FUNC xmalloc_readlink_or_warn(const char *path)
88{ 88{
89 char *buf = xmalloc_readlink(path); 89 char *buf = xmalloc_readlink(path);
90 if (!buf) { 90 if (!buf) {
@@ -96,7 +96,7 @@ char *xmalloc_readlink_or_warn(const char *path)
96 96
97/* UNUSED */ 97/* UNUSED */
98#if 0 98#if 0
99char *xmalloc_realpath(const char *path) 99char* FAST_FUNC xmalloc_realpath(const char *path)
100{ 100{
101#if defined(__GLIBC__) && !defined(__UCLIBC__) 101#if defined(__GLIBC__) && !defined(__UCLIBC__)
102 /* glibc provides a non-standard extension */ 102 /* glibc provides a non-standard extension */
diff --git a/libbb/xregcomp.c b/libbb/xregcomp.c
index 157132c1f..abfa35ff1 100644
--- a/libbb/xregcomp.c
+++ b/libbb/xregcomp.c
@@ -11,7 +11,7 @@
11#include "libbb.h" 11#include "libbb.h"
12#include "xregex.h" 12#include "xregex.h"
13 13
14char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags) 14char* FAST_FUNC regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags)
15{ 15{
16 int ret = regcomp(preg, regex, cflags); 16 int ret = regcomp(preg, regex, cflags);
17 if (ret) { 17 if (ret) {
@@ -23,7 +23,7 @@ char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags)
23 return NULL; 23 return NULL;
24} 24}
25 25
26void xregcomp(regex_t *preg, const char *regex, int cflags) 26void FAST_FUNC xregcomp(regex_t *preg, const char *regex, int cflags)
27{ 27{
28 char *errmsg = regcomp_or_errmsg(preg, regex, cflags); 28 char *errmsg = regcomp_or_errmsg(preg, regex, cflags);
29 if (errmsg) { 29 if (errmsg) {