diff options
176 files changed, 847 insertions, 841 deletions
diff --git a/archival/ar.c b/archival/ar.c index 0a95e5c85..ddc12095c 100644 --- a/archival/ar.c +++ b/archival/ar.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include "libbb.h" | 16 | #include "libbb.h" |
17 | #include "unarchive.h" | 17 | #include "unarchive.h" |
18 | 18 | ||
19 | static void header_verbose_list_ar(const file_header_t *file_header) | 19 | static void FAST_FUNC header_verbose_list_ar(const file_header_t *file_header) |
20 | { | 20 | { |
21 | const char *mode = bb_mode_string(file_header->mode); | 21 | const char *mode = bb_mode_string(file_header->mode); |
22 | char *mtime; | 22 | char *mtime; |
diff --git a/archival/bbunzip.c b/archival/bbunzip.c index 09a4eb9eb..b2e816145 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c | |||
@@ -28,7 +28,7 @@ int open_to_or_warn(int to_fd, const char *filename, int flags, int mode) | |||
28 | return 0; | 28 | return 0; |
29 | } | 29 | } |
30 | 30 | ||
31 | int bbunpack(char **argv, | 31 | int FAST_FUNC bbunpack(char **argv, |
32 | char* (*make_new_name)(char *filename), | 32 | char* (*make_new_name)(char *filename), |
33 | USE_DESKTOP(long long) int (*unpacker)(void) | 33 | USE_DESKTOP(long long) int (*unpacker)(void) |
34 | ) | 34 | ) |
diff --git a/archival/dpkg.c b/archival/dpkg.c index ee5bd7aff..34e5f80e4 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1482,7 +1482,7 @@ static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, lli | |||
1482 | return ar_handle->sub_archive->buffer; | 1482 | return ar_handle->sub_archive->buffer; |
1483 | } | 1483 | } |
1484 | 1484 | ||
1485 | static void data_extract_all_prefix(archive_handle_t *archive_handle) | 1485 | static void FAST_FUNC data_extract_all_prefix(archive_handle_t *archive_handle) |
1486 | { | 1486 | { |
1487 | char *name_ptr = archive_handle->file_header->name; | 1487 | char *name_ptr = archive_handle->file_header->name; |
1488 | 1488 | ||
diff --git a/archival/libunarchive/archive_xread_all_eof.c b/archival/libunarchive/archive_xread_all_eof.c index c93dfa282..f11a7fd32 100644 --- a/archival/libunarchive/archive_xread_all_eof.c +++ b/archival/libunarchive/archive_xread_all_eof.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, | 9 | ssize_t FAST_FUNC archive_xread_all_eof(archive_handle_t *archive_handle, |
10 | unsigned char *buf, size_t count) | 10 | unsigned char *buf, size_t count) |
11 | { | 11 | { |
12 | ssize_t size; | 12 | ssize_t size; |
diff --git a/archival/libunarchive/data_align.c b/archival/libunarchive/data_align.c index d98dc5764..9f2e8432f 100644 --- a/archival/libunarchive/data_align.c +++ b/archival/libunarchive/data_align.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | void data_align(archive_handle_t *archive_handle, unsigned boundary) | 9 | void FAST_FUNC data_align(archive_handle_t *archive_handle, unsigned boundary) |
10 | { | 10 | { |
11 | unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary; | 11 | unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary; |
12 | 12 | ||
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c index 29a224bbc..1b4876799 100644 --- a/archival/libunarchive/data_extract_all.c +++ b/archival/libunarchive/data_extract_all.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | void data_extract_all(archive_handle_t *archive_handle) | 9 | void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) |
10 | { | 10 | { |
11 | file_header_t *file_header = archive_handle->file_header; | 11 | file_header_t *file_header = archive_handle->file_header; |
12 | int dst_fd; | 12 | int dst_fd; |
diff --git a/archival/libunarchive/data_extract_to_buffer.c b/archival/libunarchive/data_extract_to_buffer.c index d8fcdf3d3..1d74e0335 100644 --- a/archival/libunarchive/data_extract_to_buffer.c +++ b/archival/libunarchive/data_extract_to_buffer.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include "libbb.h" | 8 | #include "libbb.h" |
9 | #include "unarchive.h" | 9 | #include "unarchive.h" |
10 | 10 | ||
11 | void data_extract_to_buffer(archive_handle_t *archive_handle) | 11 | void FAST_FUNC data_extract_to_buffer(archive_handle_t *archive_handle) |
12 | { | 12 | { |
13 | unsigned int size = archive_handle->file_header->size; | 13 | unsigned int size = archive_handle->file_header->size; |
14 | 14 | ||
diff --git a/archival/libunarchive/data_extract_to_stdout.c b/archival/libunarchive/data_extract_to_stdout.c index c8895ed65..a3efea16d 100644 --- a/archival/libunarchive/data_extract_to_stdout.c +++ b/archival/libunarchive/data_extract_to_stdout.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | void data_extract_to_stdout(archive_handle_t *archive_handle) | 9 | void FAST_FUNC data_extract_to_stdout(archive_handle_t *archive_handle) |
10 | { | 10 | { |
11 | bb_copyfd_exact_size(archive_handle->src_fd, | 11 | bb_copyfd_exact_size(archive_handle->src_fd, |
12 | STDOUT_FILENO, | 12 | STDOUT_FILENO, |
diff --git a/archival/libunarchive/data_skip.c b/archival/libunarchive/data_skip.c index d9778da2e..438750fe5 100644 --- a/archival/libunarchive/data_skip.c +++ b/archival/libunarchive/data_skip.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | void data_skip(archive_handle_t *archive_handle) | 9 | void FAST_FUNC data_skip(archive_handle_t *archive_handle) |
10 | { | 10 | { |
11 | archive_handle->seek(archive_handle, archive_handle->file_header->size); | 11 | archive_handle->seek(archive_handle, archive_handle->file_header->size); |
12 | } | 12 | } |
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c index f5050449a..106a08b54 100644 --- a/archival/libunarchive/decompress_bunzip2.c +++ b/archival/libunarchive/decompress_bunzip2.c | |||
@@ -526,7 +526,7 @@ static int get_next_block(bunzip_data *bd) | |||
526 | are ignored, data is written to out_fd and return is RETVAL_OK or error. | 526 | are ignored, data is written to out_fd and return is RETVAL_OK or error. |
527 | */ | 527 | */ |
528 | 528 | ||
529 | int read_bunzip(bunzip_data *bd, char *outbuf, int len) | 529 | int FAST_FUNC read_bunzip(bunzip_data *bd, char *outbuf, int len) |
530 | { | 530 | { |
531 | const unsigned *dbuf; | 531 | const unsigned *dbuf; |
532 | int pos, current, previous, gotcount; | 532 | int pos, current, previous, gotcount; |
@@ -643,7 +643,7 @@ int read_bunzip(bunzip_data *bd, char *outbuf, int len) | |||
643 | should work for NOFORK applets too, we must be extremely careful to not leak | 643 | should work for NOFORK applets too, we must be extremely careful to not leak |
644 | any allocations! */ | 644 | any allocations! */ |
645 | 645 | ||
646 | int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf, | 646 | int FAST_FUNC start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf, |
647 | int len) | 647 | int len) |
648 | { | 648 | { |
649 | bunzip_data *bd; | 649 | bunzip_data *bd; |
@@ -699,7 +699,7 @@ int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf, | |||
699 | return RETVAL_OK; | 699 | return RETVAL_OK; |
700 | } | 700 | } |
701 | 701 | ||
702 | void dealloc_bunzip(bunzip_data *bd) | 702 | void FAST_FUNC dealloc_bunzip(bunzip_data *bd) |
703 | { | 703 | { |
704 | free(bd->dbuf); | 704 | free(bd->dbuf); |
705 | free(bd); | 705 | free(bd); |
@@ -708,7 +708,7 @@ void dealloc_bunzip(bunzip_data *bd) | |||
708 | 708 | ||
709 | /* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */ | 709 | /* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */ |
710 | 710 | ||
711 | USE_DESKTOP(long long) int | 711 | USE_DESKTOP(long long) int FAST_FUNC |
712 | unpack_bz2_stream(int src_fd, int dst_fd) | 712 | unpack_bz2_stream(int src_fd, int dst_fd) |
713 | { | 713 | { |
714 | USE_DESKTOP(long long total_written = 0;) | 714 | USE_DESKTOP(long long total_written = 0;) |
diff --git a/archival/libunarchive/decompress_uncompress.c b/archival/libunarchive/decompress_uncompress.c index 8c3c65d1a..161570040 100644 --- a/archival/libunarchive/decompress_uncompress.c +++ b/archival/libunarchive/decompress_uncompress.c | |||
@@ -70,7 +70,7 @@ | |||
70 | * be stored in the compressed file. | 70 | * be stored in the compressed file. |
71 | */ | 71 | */ |
72 | 72 | ||
73 | USE_DESKTOP(long long) int | 73 | USE_DESKTOP(long long) int FAST_FUNC |
74 | uncompress(int fd_in, int fd_out) | 74 | uncompress(int fd_in, int fd_out) |
75 | { | 75 | { |
76 | USE_DESKTOP(long long total_written = 0;) | 76 | USE_DESKTOP(long long total_written = 0;) |
diff --git a/archival/libunarchive/decompress_unlzma.c b/archival/libunarchive/decompress_unlzma.c index c32040075..79df70179 100644 --- a/archival/libunarchive/decompress_unlzma.c +++ b/archival/libunarchive/decompress_unlzma.c | |||
@@ -229,7 +229,7 @@ enum { | |||
229 | }; | 229 | }; |
230 | 230 | ||
231 | 231 | ||
232 | USE_DESKTOP(long long) int | 232 | USE_DESKTOP(long long) int FAST_FUNC |
233 | unpack_lzma_stream(int src_fd, int dst_fd) | 233 | unpack_lzma_stream(int src_fd, int dst_fd) |
234 | { | 234 | { |
235 | USE_DESKTOP(long long total_written = 0;) | 235 | USE_DESKTOP(long long total_written = 0;) |
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index 9036fabf2..3b0ca846a 100644 --- a/archival/libunarchive/decompress_unzip.c +++ b/archival/libunarchive/decompress_unzip.c | |||
@@ -1033,7 +1033,7 @@ inflate_unzip_internal(STATE_PARAM int in, int out) | |||
1033 | 1033 | ||
1034 | /* For unzip */ | 1034 | /* For unzip */ |
1035 | 1035 | ||
1036 | USE_DESKTOP(long long) int | 1036 | USE_DESKTOP(long long) int FAST_FUNC |
1037 | inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out) | 1037 | inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out) |
1038 | { | 1038 | { |
1039 | USE_DESKTOP(long long) int n; | 1039 | USE_DESKTOP(long long) int n; |
@@ -1176,7 +1176,7 @@ static int check_header_gzip(STATE_PARAM_ONLY) | |||
1176 | return 1; | 1176 | return 1; |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | USE_DESKTOP(long long) int | 1179 | USE_DESKTOP(long long) int FAST_FUNC |
1180 | unpack_gz_stream(int in, int out) | 1180 | unpack_gz_stream(int in, int out) |
1181 | { | 1181 | { |
1182 | uint32_t v32; | 1182 | uint32_t v32; |
diff --git a/archival/libunarchive/filter_accept_all.c b/archival/libunarchive/filter_accept_all.c index 47d771e43..21f9c5c9e 100644 --- a/archival/libunarchive/filter_accept_all.c +++ b/archival/libunarchive/filter_accept_all.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include "unarchive.h" | 9 | #include "unarchive.h" |
10 | 10 | ||
11 | /* Accept any non-null name, its not really a filter at all */ | 11 | /* Accept any non-null name, its not really a filter at all */ |
12 | char filter_accept_all(archive_handle_t *archive_handle) | 12 | char FAST_FUNC filter_accept_all(archive_handle_t *archive_handle) |
13 | { | 13 | { |
14 | if (archive_handle->file_header->name) | 14 | if (archive_handle->file_header->name) |
15 | return EXIT_SUCCESS; | 15 | return EXIT_SUCCESS; |
diff --git a/archival/libunarchive/filter_accept_list.c b/archival/libunarchive/filter_accept_list.c index 6e571ad4e..afa0b4cbf 100644 --- a/archival/libunarchive/filter_accept_list.c +++ b/archival/libunarchive/filter_accept_list.c | |||
@@ -11,7 +11,7 @@ | |||
11 | /* | 11 | /* |
12 | * Accept names that are in the accept list, ignoring reject list. | 12 | * Accept names that are in the accept list, ignoring reject list. |
13 | */ | 13 | */ |
14 | char filter_accept_list(archive_handle_t *archive_handle) | 14 | char FAST_FUNC filter_accept_list(archive_handle_t *archive_handle) |
15 | { | 15 | { |
16 | if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) | 16 | if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) |
17 | return EXIT_SUCCESS; | 17 | return EXIT_SUCCESS; |
diff --git a/archival/libunarchive/filter_accept_list_reassign.c b/archival/libunarchive/filter_accept_list_reassign.c index 969dd1e3e..4f2d4cde5 100644 --- a/archival/libunarchive/filter_accept_list_reassign.c +++ b/archival/libunarchive/filter_accept_list_reassign.c | |||
@@ -13,7 +13,7 @@ | |||
13 | * e.g. if its a .tar.gz modify archive_handle->sub_archive to process a .tar.gz | 13 | * e.g. if its a .tar.gz modify archive_handle->sub_archive to process a .tar.gz |
14 | * or if its a .tar.bz2 make archive_handle->sub_archive handle that | 14 | * or if its a .tar.bz2 make archive_handle->sub_archive handle that |
15 | */ | 15 | */ |
16 | char filter_accept_list_reassign(archive_handle_t *archive_handle) | 16 | char FAST_FUNC filter_accept_list_reassign(archive_handle_t *archive_handle) |
17 | { | 17 | { |
18 | /* Check the file entry is in the accept list */ | 18 | /* Check the file entry is in the accept list */ |
19 | if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) { | 19 | if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) { |
diff --git a/archival/libunarchive/filter_accept_reject_list.c b/archival/libunarchive/filter_accept_reject_list.c index 439ba20ca..aa601e137 100644 --- a/archival/libunarchive/filter_accept_reject_list.c +++ b/archival/libunarchive/filter_accept_reject_list.c | |||
@@ -11,7 +11,7 @@ | |||
11 | /* | 11 | /* |
12 | * Accept names that are in the accept list and not in the reject list | 12 | * Accept names that are in the accept list and not in the reject list |
13 | */ | 13 | */ |
14 | char filter_accept_reject_list(archive_handle_t *archive_handle) | 14 | char FAST_FUNC filter_accept_reject_list(archive_handle_t *archive_handle) |
15 | { | 15 | { |
16 | const char *key; | 16 | const char *key; |
17 | const llist_t *reject_entry; | 17 | const llist_t *reject_entry; |
diff --git a/archival/libunarchive/find_list_entry.c b/archival/libunarchive/find_list_entry.c index 754058953..bc7bc6471 100644 --- a/archival/libunarchive/find_list_entry.c +++ b/archival/libunarchive/find_list_entry.c | |||
@@ -10,7 +10,7 @@ | |||
10 | #include "unarchive.h" | 10 | #include "unarchive.h" |
11 | 11 | ||
12 | /* Find a string in a shell pattern list */ | 12 | /* Find a string in a shell pattern list */ |
13 | const llist_t *find_list_entry(const llist_t *list, const char *filename) | 13 | const llist_t* FAST_FUNC find_list_entry(const llist_t *list, const char *filename) |
14 | { | 14 | { |
15 | while (list) { | 15 | while (list) { |
16 | if (fnmatch(list->data, filename, 0) == 0) { | 16 | if (fnmatch(list->data, filename, 0) == 0) { |
@@ -24,7 +24,7 @@ const llist_t *find_list_entry(const llist_t *list, const char *filename) | |||
24 | /* Same, but compares only path components present in pattern | 24 | /* Same, but compares only path components present in pattern |
25 | * (extra trailing path components in filename are assumed to match) | 25 | * (extra trailing path components in filename are assumed to match) |
26 | */ | 26 | */ |
27 | const llist_t *find_list_entry2(const llist_t *list, const char *filename) | 27 | const llist_t* FAST_FUNC find_list_entry2(const llist_t *list, const char *filename) |
28 | { | 28 | { |
29 | char buf[PATH_MAX]; | 29 | char buf[PATH_MAX]; |
30 | int pattern_slash_cnt; | 30 | int pattern_slash_cnt; |
diff --git a/archival/libunarchive/get_header_ar.c b/archival/libunarchive/get_header_ar.c index 88c0220ad..05222992d 100644 --- a/archival/libunarchive/get_header_ar.c +++ b/archival/libunarchive/get_header_ar.c | |||
@@ -7,7 +7,7 @@ | |||
7 | #include "libbb.h" | 7 | #include "libbb.h" |
8 | #include "unarchive.h" | 8 | #include "unarchive.h" |
9 | 9 | ||
10 | char get_header_ar(archive_handle_t *archive_handle) | 10 | char FAST_FUNC get_header_ar(archive_handle_t *archive_handle) |
11 | { | 11 | { |
12 | int err; | 12 | int err; |
13 | file_header_t *typed = archive_handle->file_header; | 13 | file_header_t *typed = archive_handle->file_header; |
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c index b97b53b20..4ed18c68f 100644 --- a/archival/libunarchive/get_header_cpio.c +++ b/archival/libunarchive/get_header_cpio.c | |||
@@ -17,7 +17,7 @@ typedef struct hardlinks_s { | |||
17 | char name[1]; | 17 | char name[1]; |
18 | } hardlinks_t; | 18 | } hardlinks_t; |
19 | 19 | ||
20 | char get_header_cpio(archive_handle_t *archive_handle) | 20 | char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle) |
21 | { | 21 | { |
22 | static hardlinks_t *saved_hardlinks = NULL; | 22 | static hardlinks_t *saved_hardlinks = NULL; |
23 | static hardlinks_t *saved_hardlinks_created = NULL; | 23 | static hardlinks_t *saved_hardlinks_created = NULL; |
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index 187552c28..a0a53c908 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c | |||
@@ -43,7 +43,7 @@ static unsigned long long getOctal(char *str, int len) | |||
43 | #define GET_OCTAL(a) getOctal((a), sizeof(a)) | 43 | #define GET_OCTAL(a) getOctal((a), sizeof(a)) |
44 | 44 | ||
45 | void BUG_tar_header_size(void); | 45 | void BUG_tar_header_size(void); |
46 | char get_header_tar(archive_handle_t *archive_handle) | 46 | char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) |
47 | { | 47 | { |
48 | static smallint end; | 48 | static smallint end; |
49 | #if ENABLE_FEATURE_TAR_AUTODETECT | 49 | #if ENABLE_FEATURE_TAR_AUTODETECT |
@@ -133,7 +133,7 @@ char get_header_tar(archive_handle_t *archive_handle) | |||
133 | || memcmp(tar.magic, "\0\0\0\0", 5) != 0) | 133 | || memcmp(tar.magic, "\0\0\0\0", 5) != 0) |
134 | ) { | 134 | ) { |
135 | #if ENABLE_FEATURE_TAR_AUTODETECT | 135 | #if ENABLE_FEATURE_TAR_AUTODETECT |
136 | char (*get_header_ptr)(archive_handle_t *); | 136 | char FAST_FUNC (*get_header_ptr)(archive_handle_t *); |
137 | 137 | ||
138 | /* tar gz/bz autodetect: check for gz/bz2 magic. | 138 | /* tar gz/bz autodetect: check for gz/bz2 magic. |
139 | * If it is the very first block, and we see the magic, | 139 | * If it is the very first block, and we see the magic, |
diff --git a/archival/libunarchive/get_header_tar_bz2.c b/archival/libunarchive/get_header_tar_bz2.c index c2cbaff5f..cfdc016d6 100644 --- a/archival/libunarchive/get_header_tar_bz2.c +++ b/archival/libunarchive/get_header_tar_bz2.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | char get_header_tar_bz2(archive_handle_t *archive_handle) | 9 | char FAST_FUNC get_header_tar_bz2(archive_handle_t *archive_handle) |
10 | { | 10 | { |
11 | /* Can't lseek over pipes */ | 11 | /* Can't lseek over pipes */ |
12 | archive_handle->seek = seek_by_read; | 12 | archive_handle->seek = seek_by_read; |
diff --git a/archival/libunarchive/get_header_tar_gz.c b/archival/libunarchive/get_header_tar_gz.c index 9772e33fb..33c62729e 100644 --- a/archival/libunarchive/get_header_tar_gz.c +++ b/archival/libunarchive/get_header_tar_gz.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | char get_header_tar_gz(archive_handle_t *archive_handle) | 9 | char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle) |
10 | { | 10 | { |
11 | #if BB_MMU | 11 | #if BB_MMU |
12 | unsigned char magic[2]; | 12 | unsigned char magic[2]; |
diff --git a/archival/libunarchive/get_header_tar_lzma.c b/archival/libunarchive/get_header_tar_lzma.c index c859dcc58..4ae125f4a 100644 --- a/archival/libunarchive/get_header_tar_lzma.c +++ b/archival/libunarchive/get_header_tar_lzma.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include "libbb.h" | 9 | #include "libbb.h" |
10 | #include "unarchive.h" | 10 | #include "unarchive.h" |
11 | 11 | ||
12 | char get_header_tar_lzma(archive_handle_t * archive_handle) | 12 | char FAST_FUNC get_header_tar_lzma(archive_handle_t * archive_handle) |
13 | { | 13 | { |
14 | /* Can't lseek over pipes */ | 14 | /* Can't lseek over pipes */ |
15 | archive_handle->seek = seek_by_read; | 15 | archive_handle->seek = seek_by_read; |
diff --git a/archival/libunarchive/header_list.c b/archival/libunarchive/header_list.c index 8cb8f40d9..6ec2df363 100644 --- a/archival/libunarchive/header_list.c +++ b/archival/libunarchive/header_list.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include "libbb.h" | 5 | #include "libbb.h" |
6 | #include "unarchive.h" | 6 | #include "unarchive.h" |
7 | 7 | ||
8 | void header_list(const file_header_t *file_header) | 8 | void FAST_FUNC header_list(const file_header_t *file_header) |
9 | { | 9 | { |
10 | puts(file_header->name); | 10 | puts(file_header->name); |
11 | } | 11 | } |
diff --git a/archival/libunarchive/header_skip.c b/archival/libunarchive/header_skip.c index ef2172bb3..ba4c0ab4b 100644 --- a/archival/libunarchive/header_skip.c +++ b/archival/libunarchive/header_skip.c | |||
@@ -5,6 +5,6 @@ | |||
5 | #include "libbb.h" | 5 | #include "libbb.h" |
6 | #include "unarchive.h" | 6 | #include "unarchive.h" |
7 | 7 | ||
8 | void header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED) | 8 | void FAST_FUNC header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED) |
9 | { | 9 | { |
10 | } | 10 | } |
diff --git a/archival/libunarchive/header_verbose_list.c b/archival/libunarchive/header_verbose_list.c index ea623ed85..f059dd981 100644 --- a/archival/libunarchive/header_verbose_list.c +++ b/archival/libunarchive/header_verbose_list.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | void header_verbose_list(const file_header_t *file_header) | 9 | void FAST_FUNC header_verbose_list(const file_header_t *file_header) |
10 | { | 10 | { |
11 | struct tm *mtime = localtime(&(file_header->mtime)); | 11 | struct tm *mtime = localtime(&(file_header->mtime)); |
12 | 12 | ||
diff --git a/archival/libunarchive/init_handle.c b/archival/libunarchive/init_handle.c index 309d329ea..ff7d484e5 100644 --- a/archival/libunarchive/init_handle.c +++ b/archival/libunarchive/init_handle.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | archive_handle_t *init_handle(void) | 9 | archive_handle_t* FAST_FUNC init_handle(void) |
10 | { | 10 | { |
11 | archive_handle_t *archive_handle; | 11 | archive_handle_t *archive_handle; |
12 | 12 | ||
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c index 86415c749..a6bc62321 100644 --- a/archival/libunarchive/open_transformer.c +++ b/archival/libunarchive/open_transformer.c | |||
@@ -11,8 +11,8 @@ | |||
11 | * On MMU machine, the transform_prog is removed by macro magic | 11 | * On MMU machine, the transform_prog is removed by macro magic |
12 | * in include/unarchive.h. On NOMMU, transformer is removed. | 12 | * in include/unarchive.h. On NOMMU, transformer is removed. |
13 | */ | 13 | */ |
14 | int open_transformer(int src_fd, | 14 | int FAST_FUNC open_transformer(int src_fd, |
15 | USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd), | 15 | USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd), |
16 | const char *transform_prog) | 16 | const char *transform_prog) |
17 | { | 17 | { |
18 | struct fd_pair fd_pipe; | 18 | struct fd_pair fd_pipe; |
diff --git a/archival/libunarchive/seek_by_jump.c b/archival/libunarchive/seek_by_jump.c index 5288c1d73..031598e7a 100644 --- a/archival/libunarchive/seek_by_jump.c +++ b/archival/libunarchive/seek_by_jump.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount) | 9 | void FAST_FUNC seek_by_jump(const archive_handle_t *archive_handle, unsigned amount) |
10 | { | 10 | { |
11 | if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) { | 11 | if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) { |
12 | if (errno == ESPIPE) | 12 | if (errno == ESPIPE) |
diff --git a/archival/libunarchive/seek_by_read.c b/archival/libunarchive/seek_by_read.c index 1f2b80571..2326a7512 100644 --- a/archival/libunarchive/seek_by_read.c +++ b/archival/libunarchive/seek_by_read.c | |||
@@ -9,7 +9,7 @@ | |||
9 | /* If we are reading through a pipe, or from stdin then we can't lseek, | 9 | /* If we are reading through a pipe, or from stdin then we can't lseek, |
10 | * we must read and discard the data to skip over it. | 10 | * we must read and discard the data to skip over it. |
11 | */ | 11 | */ |
12 | void seek_by_read(const archive_handle_t *archive_handle, unsigned jump_size) | 12 | void FAST_FUNC seek_by_read(const archive_handle_t *archive_handle, unsigned jump_size) |
13 | { | 13 | { |
14 | if (jump_size) | 14 | if (jump_size) |
15 | bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size); | 15 | bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size); |
diff --git a/archival/libunarchive/unpack_ar_archive.c b/archival/libunarchive/unpack_ar_archive.c index fc1820b97..9c2f68b14 100644 --- a/archival/libunarchive/unpack_ar_archive.c +++ b/archival/libunarchive/unpack_ar_archive.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | void unpack_ar_archive(archive_handle_t *ar_archive) | 9 | void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive) |
10 | { | 10 | { |
11 | char magic[7]; | 11 | char magic[7]; |
12 | 12 | ||
diff --git a/archival/rpm.c b/archival/rpm.c index 41b8c81b2..3d03dbcce 100644 --- a/archival/rpm.c +++ b/archival/rpm.c | |||
@@ -190,7 +190,7 @@ static void extract_cpio_gz(int fd) | |||
190 | archive_handle_t *archive_handle; | 190 | archive_handle_t *archive_handle; |
191 | unsigned char magic[2]; | 191 | unsigned char magic[2]; |
192 | #if BB_MMU | 192 | #if BB_MMU |
193 | USE_DESKTOP(long long) int (*xformer)(int src_fd, int dst_fd); | 193 | USE_DESKTOP(long long) int FAST_FUNC (*xformer)(int src_fd, int dst_fd); |
194 | enum { xformer_prog = 0 }; | 194 | enum { xformer_prog = 0 }; |
195 | #else | 195 | #else |
196 | enum { xformer = 0 }; | 196 | enum { xformer = 0 }; |
diff --git a/archival/tar.c b/archival/tar.c index 0162e0623..2a140184c 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -396,7 +396,7 @@ static int exclude_file(const llist_t *excluded_files, const char *file) | |||
396 | #define exclude_file(excluded_files, file) 0 | 396 | #define exclude_file(excluded_files, file) 0 |
397 | #endif | 397 | #endif |
398 | 398 | ||
399 | static int writeFileToTarball(const char *fileName, struct stat *statbuf, | 399 | static int FAST_FUNC writeFileToTarball(const char *fileName, struct stat *statbuf, |
400 | void *userData, int depth ATTRIBUTE_UNUSED) | 400 | void *userData, int depth ATTRIBUTE_UNUSED) |
401 | { | 401 | { |
402 | struct TarBallInfo *tbInfo = (struct TarBallInfo *) userData; | 402 | struct TarBallInfo *tbInfo = (struct TarBallInfo *) userData; |
@@ -680,7 +680,7 @@ static llist_t *append_file_list_to_list(llist_t *list) | |||
680 | #endif | 680 | #endif |
681 | 681 | ||
682 | #if ENABLE_FEATURE_TAR_COMPRESS | 682 | #if ENABLE_FEATURE_TAR_COMPRESS |
683 | static char get_header_tar_Z(archive_handle_t *archive_handle) | 683 | static char FAST_FUNC get_header_tar_Z(archive_handle_t *archive_handle) |
684 | { | 684 | { |
685 | /* Can't lseek over pipes */ | 685 | /* Can't lseek over pipes */ |
686 | archive_handle->seek = seek_by_read; | 686 | archive_handle->seek = seek_by_read; |
@@ -802,7 +802,7 @@ static const char tar_longopts[] ALIGN1 = | |||
802 | int tar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 802 | int tar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
803 | int tar_main(int argc ATTRIBUTE_UNUSED, char **argv) | 803 | int tar_main(int argc ATTRIBUTE_UNUSED, char **argv) |
804 | { | 804 | { |
805 | char (*get_header_ptr)(archive_handle_t *) = get_header_tar; | 805 | char FAST_FUNC (*get_header_ptr)(archive_handle_t *) = get_header_tar; |
806 | archive_handle_t *tar_handle; | 806 | archive_handle_t *tar_handle; |
807 | char *base_dir = NULL; | 807 | char *base_dir = NULL; |
808 | const char *tar_filename = "-"; | 808 | const char *tar_filename = "-"; |
diff --git a/coreutils/chmod.c b/coreutils/chmod.c index 1bd0bd5c2..994308c89 100644 --- a/coreutils/chmod.c +++ b/coreutils/chmod.c | |||
@@ -34,7 +34,7 @@ | |||
34 | * symbolic links encountered during recursive directory traversals. | 34 | * symbolic links encountered during recursive directory traversals. |
35 | */ | 35 | */ |
36 | 36 | ||
37 | static int fileAction(const char *fileName, struct stat *statbuf, void* param, int depth) | 37 | static int FAST_FUNC fileAction(const char *fileName, struct stat *statbuf, void* param, int depth) |
38 | { | 38 | { |
39 | mode_t newmode; | 39 | mode_t newmode; |
40 | 40 | ||
diff --git a/coreutils/chown.c b/coreutils/chown.c index 78377e6a0..c14c62db6 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c | |||
@@ -41,7 +41,7 @@ typedef int (*chown_fptr)(const char *, uid_t, gid_t); | |||
41 | 41 | ||
42 | static struct bb_uidgid_t ugid = { -1, -1 }; | 42 | static struct bb_uidgid_t ugid = { -1, -1 }; |
43 | 43 | ||
44 | static int fileAction(const char *fileName, struct stat *statbuf, | 44 | static int FAST_FUNC fileAction(const char *fileName, struct stat *statbuf, |
45 | void *cf, int depth ATTRIBUTE_UNUSED) | 45 | void *cf, int depth ATTRIBUTE_UNUSED) |
46 | { | 46 | { |
47 | uid_t u = (ugid.uid == (uid_t)-1) ? statbuf->st_uid : ugid.uid; | 47 | uid_t u = (ugid.uid == (uid_t)-1) ? statbuf->st_uid : ugid.uid; |
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index c06747622..8b18b7a73 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -152,7 +152,7 @@ int uudecode_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
152 | 152 | ||
153 | /* Search for the start of the encoding */ | 153 | /* Search for the start of the encoding */ |
154 | while ((line = xmalloc_fgetline(src_stream)) != NULL) { | 154 | while ((line = xmalloc_fgetline(src_stream)) != NULL) { |
155 | void (*decode_fn_ptr)(FILE * src, FILE * dst); | 155 | void (*decode_fn_ptr)(FILE *src, FILE *dst); |
156 | char *line_ptr; | 156 | char *line_ptr; |
157 | FILE *dst_stream; | 157 | FILE *dst_stream; |
158 | int mode; | 158 | int mode; |
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c index c9b090717..bf278cc65 100644 --- a/debianutils/run_parts.c +++ b/debianutils/run_parts.c | |||
@@ -77,7 +77,7 @@ static int bb_alphasort(const void *p1, const void *p2) | |||
77 | return (option_mask32 & OPT_r) ? -r : r; | 77 | return (option_mask32 & OPT_r) ? -r : r; |
78 | } | 78 | } |
79 | 79 | ||
80 | static int act(const char *file, struct stat *statbuf, void *args ATTRIBUTE_UNUSED, int depth) | 80 | static int FAST_FUNC act(const char *file, struct stat *statbuf, void *args ATTRIBUTE_UNUSED, int depth) |
81 | { | 81 | { |
82 | if (depth == 1) | 82 | if (depth == 1) |
83 | return TRUE; | 83 | return TRUE; |
diff --git a/e2fsprogs/old_e2fsprogs/e2p/e2p.h b/e2fsprogs/old_e2fsprogs/e2p/e2p.h index 452470047..bad2d6ac9 100644 --- a/e2fsprogs/old_e2fsprogs/e2p/e2p.h +++ b/e2fsprogs/old_e2fsprogs/e2p/e2p.h | |||
@@ -37,9 +37,9 @@ int iterate_on_dir (const char * dir_name, | |||
37 | /*void list_super(struct ext2_super_block * s);*/ | 37 | /*void list_super(struct ext2_super_block * s);*/ |
38 | void list_super2(struct ext2_super_block * s, FILE *f); | 38 | void list_super2(struct ext2_super_block * s, FILE *f); |
39 | #define list_super(s) list_super2(s, stdout) | 39 | #define list_super(s) list_super2(s, stdout) |
40 | void print_fs_errors (FILE * f, unsigned short errors); | 40 | void print_fs_errors (FILE *f, unsigned short errors); |
41 | void print_flags (FILE * f, unsigned long flags, unsigned options); | 41 | void print_flags (FILE *f, unsigned long flags, unsigned options); |
42 | void print_fs_state (FILE * f, unsigned short state); | 42 | void print_fs_state (FILE *f, unsigned short state); |
43 | int setflags (int fd, unsigned long flags); | 43 | int setflags (int fd, unsigned long flags); |
44 | int setversion (int fd, unsigned long version); | 44 | int setversion (int fd, unsigned long version); |
45 | 45 | ||
diff --git a/e2fsprogs/old_e2fsprogs/e2p/pf.c b/e2fsprogs/old_e2fsprogs/e2p/pf.c index 55d4bc487..02cbec7e0 100644 --- a/e2fsprogs/old_e2fsprogs/e2p/pf.c +++ b/e2fsprogs/old_e2fsprogs/e2p/pf.c | |||
@@ -48,7 +48,7 @@ static const struct flags_name flags_array[] = { | |||
48 | { 0, NULL, NULL } | 48 | { 0, NULL, NULL } |
49 | }; | 49 | }; |
50 | 50 | ||
51 | void print_flags (FILE * f, unsigned long flags, unsigned options) | 51 | void print_flags (FILE *f, unsigned long flags, unsigned options) |
52 | { | 52 | { |
53 | int long_opt = (options & PFOPT_LONG); | 53 | int long_opt = (options & PFOPT_LONG); |
54 | const struct flags_name *fp; | 54 | const struct flags_name *fp; |
diff --git a/editors/diff.c b/editors/diff.c index ad089e2a6..d7eccfbba 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -1163,7 +1163,7 @@ static void do_diff(char *dir1, char *path1, char *dir2, char *path2) | |||
1163 | 1163 | ||
1164 | #if ENABLE_FEATURE_DIFF_DIR | 1164 | #if ENABLE_FEATURE_DIFF_DIR |
1165 | /* This function adds a filename to dl, the directory listing. */ | 1165 | /* This function adds a filename to dl, the directory listing. */ |
1166 | static int add_to_dirlist(const char *filename, | 1166 | static int FAST_FUNC add_to_dirlist(const char *filename, |
1167 | struct stat *sb ATTRIBUTE_UNUSED, | 1167 | struct stat *sb ATTRIBUTE_UNUSED, |
1168 | void *userdata, | 1168 | void *userdata, |
1169 | int depth ATTRIBUTE_UNUSED) | 1169 | int depth ATTRIBUTE_UNUSED) |
diff --git a/editors/sed.c b/editors/sed.c index bf01fc630..81cc19580 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -23,7 +23,7 @@ | |||
23 | resulting sed_cmd_t structures are appended to a linked list | 23 | resulting sed_cmd_t structures are appended to a linked list |
24 | (G.sed_cmd_head/G.sed_cmd_tail). | 24 | (G.sed_cmd_head/G.sed_cmd_tail). |
25 | 25 | ||
26 | add_input_file() adds a FILE * to the list of input files. We need to | 26 | add_input_file() adds a FILE* to the list of input files. We need to |
27 | know all input sources ahead of time to find the last line for the $ match. | 27 | know all input sources ahead of time to find the last line for the $ match. |
28 | 28 | ||
29 | process_files() does actual sedding, reading data lines from each input FILE * | 29 | process_files() does actual sedding, reading data lines from each input FILE * |
diff --git a/editors/vi.c b/editors/vi.c index 7603c9764..1b335d9a1 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -1659,12 +1659,12 @@ static char *char_insert(char *p, char c) // insert the char c at 'p' | |||
1659 | cmdcnt = 0; | 1659 | cmdcnt = 0; |
1660 | end_cmd_q(); // stop adding to q | 1660 | end_cmd_q(); // stop adding to q |
1661 | last_status_cksum = 0; // force status update | 1661 | last_status_cksum = 0; // force status update |
1662 | if ((p > text) && (p[-1] != '\n')) { | 1662 | if ((p[-1] != '\n') && (dot > text)) { |
1663 | p--; | 1663 | p--; |
1664 | } | 1664 | } |
1665 | } else if (c == erase_char || c == 8 || c == 127) { // Is this a BS | 1665 | } else if (c == erase_char || c == 8 || c == 127) { // Is this a BS |
1666 | // 123456789 | 1666 | // 123456789 |
1667 | if ((p > text) && (p[-1] != '\n')) { | 1667 | if ((p[-1] != '\n') && (dot>text)) { |
1668 | p--; | 1668 | p--; |
1669 | p = text_hole_delete(p, p); // shrink buffer 1 char | 1669 | p = text_hole_delete(p, p); // shrink buffer 1 char |
1670 | } | 1670 | } |
diff --git a/findutils/find.c b/findutils/find.c index f75bc9ef9..51d26c00a 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -374,7 +374,7 @@ ACTF(context) | |||
374 | #endif | 374 | #endif |
375 | 375 | ||
376 | 376 | ||
377 | static int fileAction(const char *fileName, | 377 | static int FAST_FUNC fileAction(const char *fileName, |
378 | struct stat *statbuf, | 378 | struct stat *statbuf, |
379 | void *userData SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED), | 379 | void *userData SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED), |
380 | int depth SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED)) | 380 | int depth SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED)) |
diff --git a/findutils/grep.c b/findutils/grep.c index 9792ce479..8d18f43ec 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -370,7 +370,7 @@ static void load_regexes_from_file(llist_t *fopt) | |||
370 | } | 370 | } |
371 | } | 371 | } |
372 | 372 | ||
373 | static int file_action_grep(const char *filename, | 373 | static int FAST_FUNC file_action_grep(const char *filename, |
374 | struct stat *statbuf ATTRIBUTE_UNUSED, | 374 | struct stat *statbuf ATTRIBUTE_UNUSED, |
375 | void* matched, | 375 | void* matched, |
376 | int depth ATTRIBUTE_UNUSED) | 376 | int depth ATTRIBUTE_UNUSED) |
diff --git a/include/dump.h b/include/dump.h index 20c39c41e..a060c1479 100644 --- a/include/dump.h +++ b/include/dump.h | |||
@@ -44,9 +44,9 @@ typedef struct _fs { /* format strings */ | |||
44 | int bcnt; | 44 | int bcnt; |
45 | } FS; | 45 | } FS; |
46 | 46 | ||
47 | extern void bb_dump_add(const char *fmt); | 47 | extern void bb_dump_add(const char *fmt) FAST_FUNC; |
48 | extern int bb_dump_dump(char **argv); | 48 | extern int bb_dump_dump(char **argv) FAST_FUNC; |
49 | extern int bb_dump_size(FS * fs); | 49 | extern int bb_dump_size(FS * fs) FAST_FUNC; |
50 | 50 | ||
51 | extern FS *bb_dump_fshead; /* head of format strings */ | 51 | extern FS *bb_dump_fshead; /* head of format strings */ |
52 | extern int bb_dump_blocksize; /* data block size */ | 52 | extern int bb_dump_blocksize; /* data block size */ |
diff --git a/include/inet_common.h b/include/inet_common.h index eb4cb7325..f4374e5a2 100644 --- a/include/inet_common.h +++ b/include/inet_common.h | |||
@@ -12,15 +12,15 @@ | |||
12 | /* hostfirst!=0 If we expect this to be a hostname, | 12 | /* hostfirst!=0 If we expect this to be a hostname, |
13 | try hostname database first | 13 | try hostname database first |
14 | */ | 14 | */ |
15 | int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst); | 15 | int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) FAST_FUNC; |
16 | 16 | ||
17 | /* numeric: & 0x8000: "default" instead of "*", | 17 | /* numeric: & 0x8000: "default" instead of "*", |
18 | * & 0x4000: host instead of net, | 18 | * & 0x4000: host instead of net, |
19 | * & 0x0fff: don't resolve | 19 | * & 0x0fff: don't resolve |
20 | */ | 20 | */ |
21 | 21 | ||
22 | int INET6_resolve(const char *name, struct sockaddr_in6 *sin6); | 22 | int INET6_resolve(const char *name, struct sockaddr_in6 *sin6) FAST_FUNC; |
23 | 23 | ||
24 | /* These return malloced string */ | 24 | /* These return malloced string */ |
25 | char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask); | 25 | char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) FAST_FUNC; |
26 | char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric); | 26 | char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) FAST_FUNC; |
diff --git a/include/libbb.h b/include/libbb.h index e92dbc4c0..d74f8021b 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -237,18 +237,18 @@ extern int *const bb_errno; | |||
237 | #define errno (*bb_errno) | 237 | #define errno (*bb_errno) |
238 | #endif | 238 | #endif |
239 | 239 | ||
240 | unsigned long long monotonic_us(void); | 240 | unsigned long long monotonic_us(void) FAST_FUNC; |
241 | unsigned monotonic_sec(void); | 241 | unsigned monotonic_sec(void) FAST_FUNC; |
242 | 242 | ||
243 | extern void chomp(char *s); | 243 | extern void chomp(char *s) FAST_FUNC; |
244 | extern void trim(char *s); | 244 | extern void trim(char *s) FAST_FUNC; |
245 | extern char *skip_whitespace(const char *); | 245 | extern char *skip_whitespace(const char *) FAST_FUNC; |
246 | extern char *skip_non_whitespace(const char *); | 246 | extern char *skip_non_whitespace(const char *) FAST_FUNC; |
247 | extern char *strrstr(const char *haystack, const char *needle); | 247 | extern char *strrstr(const char *haystack, const char *needle) FAST_FUNC; |
248 | 248 | ||
249 | //TODO: supply a pointer to char[11] buffer (avoid statics)? | 249 | //TODO: supply a pointer to char[11] buffer (avoid statics)? |
250 | extern const char *bb_mode_string(mode_t mode); | 250 | extern const char *bb_mode_string(mode_t mode) FAST_FUNC; |
251 | extern int is_directory(const char *name, int followLinks, struct stat *statBuf); | 251 | extern int is_directory(const char *name, int followLinks, struct stat *statBuf) FAST_FUNC; |
252 | enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ | 252 | enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ |
253 | FILEUTILS_PRESERVE_STATUS = 1, | 253 | FILEUTILS_PRESERVE_STATUS = 1, |
254 | FILEUTILS_DEREFERENCE = 2, | 254 | FILEUTILS_DEREFERENCE = 2, |
@@ -264,12 +264,12 @@ enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ | |||
264 | #endif | 264 | #endif |
265 | }; | 265 | }; |
266 | #define FILEUTILS_CP_OPTSTR "pdRfilsL" USE_SELINUX("c") | 266 | #define FILEUTILS_CP_OPTSTR "pdRfilsL" USE_SELINUX("c") |
267 | extern int remove_file(const char *path, int flags); | 267 | extern int remove_file(const char *path, int flags) FAST_FUNC; |
268 | /* NB: without FILEUTILS_RECUR in flags, it will basically "cat" | 268 | /* NB: without FILEUTILS_RECUR in flags, it will basically "cat" |
269 | * the source, not copy (unless "source" is a directory). | 269 | * the source, not copy (unless "source" is a directory). |
270 | * This makes "cp /dev/null file" and "install /dev/null file" (!!!) | 270 | * This makes "cp /dev/null file" and "install /dev/null file" (!!!) |
271 | * work coreutils-compatibly. */ | 271 | * work coreutils-compatibly. */ |
272 | extern int copy_file(const char *source, const char *dest, int flags); | 272 | extern int copy_file(const char *source, const char *dest, int flags) FAST_FUNC; |
273 | 273 | ||
274 | enum { | 274 | enum { |
275 | ACTION_RECURSE = (1 << 0), | 275 | ACTION_RECURSE = (1 << 0), |
@@ -279,49 +279,49 @@ enum { | |||
279 | /*ACTION_REVERSE = (1 << 4), - unused */ | 279 | /*ACTION_REVERSE = (1 << 4), - unused */ |
280 | }; | 280 | }; |
281 | extern int recursive_action(const char *fileName, unsigned flags, | 281 | extern int recursive_action(const char *fileName, unsigned flags, |
282 | int (*fileAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), | 282 | int FAST_FUNC (*fileAction)(const char *fileName, struct stat* statbuf, void* userData, int depth), |
283 | int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), | 283 | int FAST_FUNC (*dirAction)(const char *fileName, struct stat* statbuf, void* userData, int depth), |
284 | void* userData, unsigned depth); | 284 | void* userData, unsigned depth) FAST_FUNC; |
285 | extern int device_open(const char *device, int mode); | 285 | extern int device_open(const char *device, int mode) FAST_FUNC; |
286 | enum { GETPTY_BUFSIZE = 16 }; /* more than enough for "/dev/ttyXXX" */ | 286 | enum { GETPTY_BUFSIZE = 16 }; /* more than enough for "/dev/ttyXXX" */ |
287 | extern int xgetpty(char *line); | 287 | extern int xgetpty(char *line) FAST_FUNC; |
288 | extern int get_console_fd(void); | 288 | extern int get_console_fd(void) FAST_FUNC; |
289 | extern void console_make_active(int fd, const int vt_num); | 289 | extern void console_make_active(int fd, const int vt_num) FAST_FUNC; |
290 | extern char *find_block_device(const char *path); | 290 | extern char *find_block_device(const char *path) FAST_FUNC; |
291 | /* bb_copyfd_XX print read/write errors and return -1 if they occur */ | 291 | /* bb_copyfd_XX print read/write errors and return -1 if they occur */ |
292 | extern off_t bb_copyfd_eof(int fd1, int fd2); | 292 | extern off_t bb_copyfd_eof(int fd1, int fd2) FAST_FUNC; |
293 | extern off_t bb_copyfd_size(int fd1, int fd2, off_t size); | 293 | extern off_t bb_copyfd_size(int fd1, int fd2, off_t size) FAST_FUNC; |
294 | extern void bb_copyfd_exact_size(int fd1, int fd2, off_t size); | 294 | extern void bb_copyfd_exact_size(int fd1, int fd2, off_t size) FAST_FUNC; |
295 | /* "short" copy can be detected by return value < size */ | 295 | /* "short" copy can be detected by return value < size */ |
296 | /* this helper yells "short read!" if param is not -1 */ | 296 | /* this helper yells "short read!" if param is not -1 */ |
297 | extern void complain_copyfd_and_die(off_t sz) ATTRIBUTE_NORETURN; | 297 | extern void complain_copyfd_and_die(off_t sz) ATTRIBUTE_NORETURN FAST_FUNC; |
298 | extern char bb_process_escape_sequence(const char **ptr); | 298 | extern char bb_process_escape_sequence(const char **ptr) FAST_FUNC; |
299 | /* xxxx_strip version can modify its parameter: | 299 | /* xxxx_strip version can modify its parameter: |
300 | * "/" -> "/" | 300 | * "/" -> "/" |
301 | * "abc" -> "abc" | 301 | * "abc" -> "abc" |
302 | * "abc/def" -> "def" | 302 | * "abc/def" -> "def" |
303 | * "abc/def/" -> "def" !! | 303 | * "abc/def/" -> "def" !! |
304 | */ | 304 | */ |
305 | extern char *bb_get_last_path_component_strip(char *path); | 305 | extern char *bb_get_last_path_component_strip(char *path) FAST_FUNC; |
306 | /* "abc/def/" -> "" and it never modifies 'path' */ | 306 | /* "abc/def/" -> "" and it never modifies 'path' */ |
307 | extern char *bb_get_last_path_component_nostrip(const char *path); | 307 | extern char *bb_get_last_path_component_nostrip(const char *path) FAST_FUNC; |
308 | 308 | ||
309 | int ndelay_on(int fd); | 309 | int ndelay_on(int fd) FAST_FUNC; |
310 | int ndelay_off(int fd); | 310 | int ndelay_off(int fd) FAST_FUNC; |
311 | int close_on_exec_on(int fd); | 311 | int close_on_exec_on(int fd) FAST_FUNC; |
312 | void xdup2(int, int); | 312 | void xdup2(int, int) FAST_FUNC; |
313 | void xmove_fd(int, int); | 313 | void xmove_fd(int, int) FAST_FUNC; |
314 | 314 | ||
315 | 315 | ||
316 | DIR *xopendir(const char *path); | 316 | DIR *xopendir(const char *path) FAST_FUNC; |
317 | DIR *warn_opendir(const char *path); | 317 | DIR *warn_opendir(const char *path) FAST_FUNC; |
318 | 318 | ||
319 | /* UNUSED: char *xmalloc_realpath(const char *path); */ | 319 | /* UNUSED: char *xmalloc_realpath(const char *path) FAST_FUNC; */ |
320 | char *xmalloc_readlink(const char *path); | 320 | char *xmalloc_readlink(const char *path) FAST_FUNC; |
321 | char *xmalloc_readlink_or_warn(const char *path); | 321 | char *xmalloc_readlink_or_warn(const char *path) FAST_FUNC; |
322 | char *xrealloc_getcwd_or_warn(char *cwd); | 322 | char *xrealloc_getcwd_or_warn(char *cwd) FAST_FUNC; |
323 | 323 | ||
324 | char *xmalloc_follow_symlinks(const char *path); | 324 | char *xmalloc_follow_symlinks(const char *path) FAST_FUNC; |
325 | 325 | ||
326 | 326 | ||
327 | enum { | 327 | enum { |
@@ -354,43 +354,43 @@ enum { | |||
354 | + (1LL << SIGUSR2) | 354 | + (1LL << SIGUSR2) |
355 | + 0), | 355 | + 0), |
356 | }; | 356 | }; |
357 | void bb_signals(int sigs, void (*f)(int)); | 357 | void bb_signals(int sigs, void (*f)(int)) FAST_FUNC; |
358 | /* Unlike signal() and bb_signals, sets handler with sigaction() | 358 | /* Unlike signal() and bb_signals, sets handler with sigaction() |
359 | * and in a way that while signal handler is run, no other signals | 359 | * and in a way that while signal handler is run, no other signals |
360 | * will be blocked: */ | 360 | * will be blocked: */ |
361 | void bb_signals_recursive(int sigs, void (*f)(int)); | 361 | void bb_signals_recursive(int sigs, void (*f)(int)) FAST_FUNC; |
362 | /* syscalls like read() will be interrupted with EINTR: */ | 362 | /* syscalls like read() will be interrupted with EINTR: */ |
363 | void signal_no_SA_RESTART_empty_mask(int sig, void (*handler)(int)); | 363 | void signal_no_SA_RESTART_empty_mask(int sig, void (*handler)(int)) FAST_FUNC; |
364 | /* syscalls like read() won't be interrupted (though select/poll will be): */ | 364 | /* syscalls like read() won't be interrupted (though select/poll will be): */ |
365 | void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)); | 365 | void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) FAST_FUNC; |
366 | void wait_for_any_sig(void); | 366 | void wait_for_any_sig(void) FAST_FUNC; |
367 | void kill_myself_with_sig(int sig) ATTRIBUTE_NORETURN; | 367 | void kill_myself_with_sig(int sig) ATTRIBUTE_NORETURN FAST_FUNC; |
368 | void sig_block(int sig); | 368 | void sig_block(int sig) FAST_FUNC; |
369 | void sig_unblock(int sig); | 369 | void sig_unblock(int sig) FAST_FUNC; |
370 | /* Will do sigaction(signum, act, NULL): */ | 370 | /* Will do sigaction(signum, act, NULL): */ |
371 | int sigaction_set(int sig, const struct sigaction *act); | 371 | int sigaction_set(int sig, const struct sigaction *act) FAST_FUNC; |
372 | /* SIG_BLOCK/SIG_UNBLOCK all signals: */ | 372 | /* SIG_BLOCK/SIG_UNBLOCK all signals: */ |
373 | int sigprocmask_allsigs(int how); | 373 | int sigprocmask_allsigs(int how) FAST_FUNC; |
374 | 374 | ||
375 | 375 | ||
376 | void xsetgid(gid_t gid); | 376 | void xsetgid(gid_t gid) FAST_FUNC; |
377 | void xsetuid(uid_t uid); | 377 | void xsetuid(uid_t uid) FAST_FUNC; |
378 | void xchdir(const char *path); | 378 | void xchdir(const char *path) FAST_FUNC; |
379 | void xchroot(const char *path); | 379 | void xchroot(const char *path) FAST_FUNC; |
380 | void xsetenv(const char *key, const char *value); | 380 | void xsetenv(const char *key, const char *value) FAST_FUNC; |
381 | void xunlink(const char *pathname); | 381 | void xunlink(const char *pathname) FAST_FUNC; |
382 | void xstat(const char *pathname, struct stat *buf); | 382 | void xstat(const char *pathname, struct stat *buf) FAST_FUNC; |
383 | int xopen(const char *pathname, int flags); | 383 | int xopen(const char *pathname, int flags) FAST_FUNC FAST_FUNC; |
384 | int xopen3(const char *pathname, int flags, int mode); | 384 | int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; |
385 | int open_or_warn(const char *pathname, int flags); | 385 | int open_or_warn(const char *pathname, int flags) FAST_FUNC; |
386 | int open3_or_warn(const char *pathname, int flags, int mode); | 386 | int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC; |
387 | int open_or_warn_stdin(const char *pathname); | 387 | int open_or_warn_stdin(const char *pathname) FAST_FUNC; |
388 | void xrename(const char *oldpath, const char *newpath); | 388 | void xrename(const char *oldpath, const char *newpath) FAST_FUNC; |
389 | int rename_or_warn(const char *oldpath, const char *newpath); | 389 | int rename_or_warn(const char *oldpath, const char *newpath) FAST_FUNC; |
390 | off_t xlseek(int fd, off_t offset, int whence); | 390 | off_t xlseek(int fd, off_t offset, int whence) FAST_FUNC; |
391 | off_t fdlength(int fd); | 391 | off_t fdlength(int fd) FAST_FUNC; |
392 | 392 | ||
393 | void xpipe(int filedes[2]); | 393 | void xpipe(int filedes[2]) FAST_FUNC; |
394 | /* In this form code with pipes is much more readable */ | 394 | /* In this form code with pipes is much more readable */ |
395 | struct fd_pair { int rd; int wr; }; | 395 | struct fd_pair { int rd; int wr; }; |
396 | #define piped_pair(pair) pipe(&((pair).rd)) | 396 | #define piped_pair(pair) pipe(&((pair).rd)) |
@@ -424,22 +424,22 @@ struct BUG_too_small { | |||
424 | }; | 424 | }; |
425 | 425 | ||
426 | 426 | ||
427 | int xsocket(int domain, int type, int protocol); | 427 | int xsocket(int domain, int type, int protocol) FAST_FUNC; |
428 | void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen); | 428 | void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen) FAST_FUNC; |
429 | void xlisten(int s, int backlog); | 429 | void xlisten(int s, int backlog) FAST_FUNC; |
430 | void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen); | 430 | void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) FAST_FUNC; |
431 | ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, | 431 | ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, |
432 | socklen_t tolen); | 432 | socklen_t tolen) FAST_FUNC; |
433 | /* SO_REUSEADDR allows a server to rebind to an address that is already | 433 | /* SO_REUSEADDR allows a server to rebind to an address that is already |
434 | * "in use" by old connections to e.g. previous server instance which is | 434 | * "in use" by old connections to e.g. previous server instance which is |
435 | * killed or crashed. Without it bind will fail until all such connections | 435 | * killed or crashed. Without it bind will fail until all such connections |
436 | * time out. Linux does not allow multiple live binds on same ip:port | 436 | * time out. Linux does not allow multiple live binds on same ip:port |
437 | * regardless of SO_REUSEADDR (unlike some other flavors of Unix). | 437 | * regardless of SO_REUSEADDR (unlike some other flavors of Unix). |
438 | * Turn it on before you call bind(). */ | 438 | * Turn it on before you call bind(). */ |
439 | void setsockopt_reuseaddr(int fd); /* On Linux this never fails. */ | 439 | void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */ |
440 | int setsockopt_broadcast(int fd); | 440 | int setsockopt_broadcast(int fd) FAST_FUNC; |
441 | /* NB: returns port in host byte order */ | 441 | /* NB: returns port in host byte order */ |
442 | unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port); | 442 | unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) FAST_FUNC; |
443 | typedef struct len_and_sockaddr { | 443 | typedef struct len_and_sockaddr { |
444 | socklen_t len; | 444 | socklen_t len; |
445 | union { | 445 | union { |
@@ -468,87 +468,87 @@ enum { | |||
468 | * and if kernel doesn't support it, IPv4. | 468 | * and if kernel doesn't support it, IPv4. |
469 | */ | 469 | */ |
470 | #if ENABLE_FEATURE_IPV6 | 470 | #if ENABLE_FEATURE_IPV6 |
471 | int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type); | 471 | int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type) FAST_FUNC; |
472 | #else | 472 | #else |
473 | int xsocket_type(len_and_sockaddr **lsap, int sock_type); | 473 | int xsocket_type(len_and_sockaddr **lsap, int sock_type) FAST_FUNC; |
474 | #define xsocket_type(lsap, af, sock_type) xsocket_type((lsap), (sock_type)) | 474 | #define xsocket_type(lsap, af, sock_type) xsocket_type((lsap), (sock_type)) |
475 | #endif | 475 | #endif |
476 | int xsocket_stream(len_and_sockaddr **lsap); | 476 | int xsocket_stream(len_and_sockaddr **lsap) FAST_FUNC; |
477 | /* Create server socket bound to bindaddr:port. bindaddr can be NULL, | 477 | /* Create server socket bound to bindaddr:port. bindaddr can be NULL, |
478 | * numeric IP ("N.N.N.N") or numeric IPv6 address, | 478 | * numeric IP ("N.N.N.N") or numeric IPv6 address, |
479 | * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). | 479 | * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). |
480 | * Only if there is no suffix, port argument is used */ | 480 | * Only if there is no suffix, port argument is used */ |
481 | /* NB: these set SO_REUSEADDR before bind */ | 481 | /* NB: these set SO_REUSEADDR before bind */ |
482 | int create_and_bind_stream_or_die(const char *bindaddr, int port); | 482 | int create_and_bind_stream_or_die(const char *bindaddr, int port) FAST_FUNC; |
483 | int create_and_bind_dgram_or_die(const char *bindaddr, int port); | 483 | int create_and_bind_dgram_or_die(const char *bindaddr, int port) FAST_FUNC; |
484 | /* Create client TCP socket connected to peer:port. Peer cannot be NULL. | 484 | /* Create client TCP socket connected to peer:port. Peer cannot be NULL. |
485 | * Peer can be numeric IP ("N.N.N.N"), numeric IPv6 address or hostname, | 485 | * Peer can be numeric IP ("N.N.N.N"), numeric IPv6 address or hostname, |
486 | * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). | 486 | * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). |
487 | * If there is no suffix, port argument is used */ | 487 | * If there is no suffix, port argument is used */ |
488 | int create_and_connect_stream_or_die(const char *peer, int port); | 488 | int create_and_connect_stream_or_die(const char *peer, int port) FAST_FUNC; |
489 | /* Connect to peer identified by lsa */ | 489 | /* Connect to peer identified by lsa */ |
490 | int xconnect_stream(const len_and_sockaddr *lsa); | 490 | int xconnect_stream(const len_and_sockaddr *lsa) FAST_FUNC; |
491 | /* Return malloc'ed len_and_sockaddr with socket address of host:port | 491 | /* Return malloc'ed len_and_sockaddr with socket address of host:port |
492 | * Currently will return IPv4 or IPv6 sockaddrs only | 492 | * Currently will return IPv4 or IPv6 sockaddrs only |
493 | * (depending on host), but in theory nothing prevents e.g. | 493 | * (depending on host), but in theory nothing prevents e.g. |
494 | * UNIX socket address being returned, IPX sockaddr etc... | 494 | * UNIX socket address being returned, IPX sockaddr etc... |
495 | * On error does bb_error_msg and returns NULL */ | 495 | * On error does bb_error_msg and returns NULL */ |
496 | len_and_sockaddr* host2sockaddr(const char *host, int port); | 496 | len_and_sockaddr* host2sockaddr(const char *host, int port) FAST_FUNC; |
497 | /* Version which dies on error */ | 497 | /* Version which dies on error */ |
498 | len_and_sockaddr* xhost2sockaddr(const char *host, int port); | 498 | len_and_sockaddr* xhost2sockaddr(const char *host, int port) FAST_FUNC; |
499 | len_and_sockaddr* xdotted2sockaddr(const char *host, int port); | 499 | len_and_sockaddr* xdotted2sockaddr(const char *host, int port) FAST_FUNC; |
500 | /* Same, useful if you want to force family (e.g. IPv6) */ | 500 | /* Same, useful if you want to force family (e.g. IPv6) */ |
501 | #if !ENABLE_FEATURE_IPV6 | 501 | #if !ENABLE_FEATURE_IPV6 |
502 | #define host_and_af2sockaddr(host, port, af) host2sockaddr((host), (port)) | 502 | #define host_and_af2sockaddr(host, port, af) host2sockaddr((host), (port)) |
503 | #define xhost_and_af2sockaddr(host, port, af) xhost2sockaddr((host), (port)) | 503 | #define xhost_and_af2sockaddr(host, port, af) xhost2sockaddr((host), (port)) |
504 | #else | 504 | #else |
505 | len_and_sockaddr* host_and_af2sockaddr(const char *host, int port, sa_family_t af); | 505 | len_and_sockaddr* host_and_af2sockaddr(const char *host, int port, sa_family_t af) FAST_FUNC; |
506 | len_and_sockaddr* xhost_and_af2sockaddr(const char *host, int port, sa_family_t af); | 506 | len_and_sockaddr* xhost_and_af2sockaddr(const char *host, int port, sa_family_t af) FAST_FUNC; |
507 | #endif | 507 | #endif |
508 | /* Assign sin[6]_port member if the socket is an AF_INET[6] one, | 508 | /* Assign sin[6]_port member if the socket is an AF_INET[6] one, |
509 | * otherwise no-op. Useful for ftp. | 509 | * otherwise no-op. Useful for ftp. |
510 | * NB: does NOT do htons() internally, just direct assignment. */ | 510 | * NB: does NOT do htons() internally, just direct assignment. */ |
511 | void set_nport(len_and_sockaddr *lsa, unsigned port); | 511 | void set_nport(len_and_sockaddr *lsa, unsigned port) FAST_FUNC; |
512 | /* Retrieve sin[6]_port or return -1 for non-INET[6] lsa's */ | 512 | /* Retrieve sin[6]_port or return -1 for non-INET[6] lsa's */ |
513 | int get_nport(const struct sockaddr *sa); | 513 | int get_nport(const struct sockaddr *sa) FAST_FUNC; |
514 | /* Reverse DNS. Returns NULL on failure. */ | 514 | /* Reverse DNS. Returns NULL on failure. */ |
515 | char* xmalloc_sockaddr2host(const struct sockaddr *sa); | 515 | char* xmalloc_sockaddr2host(const struct sockaddr *sa) FAST_FUNC; |
516 | /* This one doesn't append :PORTNUM */ | 516 | /* This one doesn't append :PORTNUM */ |
517 | char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa); | 517 | char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa) FAST_FUNC; |
518 | /* This one also doesn't fall back to dotted IP (returns NULL) */ | 518 | /* This one also doesn't fall back to dotted IP (returns NULL) */ |
519 | char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa); | 519 | char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa) FAST_FUNC; |
520 | /* inet_[ap]ton on steroids */ | 520 | /* inet_[ap]ton on steroids */ |
521 | char* xmalloc_sockaddr2dotted(const struct sockaddr *sa); | 521 | char* xmalloc_sockaddr2dotted(const struct sockaddr *sa) FAST_FUNC; |
522 | char* xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa); | 522 | char* xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa) FAST_FUNC; |
523 | // "old" (ipv4 only) API | 523 | // "old" (ipv4 only) API |
524 | // users: traceroute.c hostname.c - use _list_ of all IPs | 524 | // users: traceroute.c hostname.c - use _list_ of all IPs |
525 | struct hostent *xgethostbyname(const char *name); | 525 | struct hostent *xgethostbyname(const char *name) FAST_FUNC; |
526 | // Also mount.c and inetd.c are using gethostbyname(), | 526 | // Also mount.c and inetd.c are using gethostbyname(), |
527 | // + inet_common.c has additional IPv4-only stuff | 527 | // + inet_common.c has additional IPv4-only stuff |
528 | 528 | ||
529 | 529 | ||
530 | void socket_want_pktinfo(int fd); | 530 | void socket_want_pktinfo(int fd) FAST_FUNC; |
531 | ssize_t send_to_from(int fd, void *buf, size_t len, int flags, | 531 | ssize_t send_to_from(int fd, void *buf, size_t len, int flags, |
532 | const struct sockaddr *to, | 532 | const struct sockaddr *to, |
533 | const struct sockaddr *from, | 533 | const struct sockaddr *from, |
534 | socklen_t tolen); | 534 | socklen_t tolen) FAST_FUNC; |
535 | ssize_t recv_from_to(int fd, void *buf, size_t len, int flags, | 535 | ssize_t recv_from_to(int fd, void *buf, size_t len, int flags, |
536 | struct sockaddr *from, | 536 | struct sockaddr *from, |
537 | struct sockaddr *to, | 537 | struct sockaddr *to, |
538 | socklen_t sa_size); | 538 | socklen_t sa_size) FAST_FUNC; |
539 | 539 | ||
540 | char *xstrdup(const char *s); | 540 | char *xstrdup(const char *s) FAST_FUNC; |
541 | char *xstrndup(const char *s, int n); | 541 | char *xstrndup(const char *s, int n) FAST_FUNC; |
542 | char *safe_strncpy(char *dst, const char *src, size_t size); | 542 | char *safe_strncpy(char *dst, const char *src, size_t size) FAST_FUNC; |
543 | /* Guaranteed to NOT be a macro (smallest code). Saves nearly 2k on uclibc. | 543 | /* Guaranteed to NOT be a macro (smallest code). Saves nearly 2k on uclibc. |
544 | * But potentially slow, don't use in one-billion-times loops */ | 544 | * But potentially slow, don't use in one-billion-times loops */ |
545 | int bb_putchar(int ch); | 545 | int bb_putchar(int ch) FAST_FUNC; |
546 | char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); | 546 | char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; |
547 | /* Prints unprintable chars ch as ^C or M-c to file | 547 | /* Prints unprintable chars ch as ^C or M-c to file |
548 | * (M-c is used only if ch is ORed with PRINTABLE_META), | 548 | * (M-c is used only if ch is ORed with PRINTABLE_META), |
549 | * else it is printed as-is (except for ch = 0x9b) */ | 549 | * else it is printed as-is (except for ch = 0x9b) */ |
550 | enum { PRINTABLE_META = 0x100 }; | 550 | enum { PRINTABLE_META = 0x100 }; |
551 | void fputc_printable(int ch, FILE *file); | 551 | void fputc_printable(int ch, FILE *file) FAST_FUNC; |
552 | // gcc-4.1.1 still isn't good enough at optimizing it | 552 | // gcc-4.1.1 still isn't good enough at optimizing it |
553 | // (+200 bytes compared to macro) | 553 | // (+200 bytes compared to macro) |
554 | //static ALWAYS_INLINE | 554 | //static ALWAYS_INLINE |
@@ -563,89 +563,89 @@ void fputc_printable(int ch, FILE *file); | |||
563 | 563 | ||
564 | /* dmalloc will redefine these to it's own implementation. It is safe | 564 | /* dmalloc will redefine these to it's own implementation. It is safe |
565 | * to have the prototypes here unconditionally. */ | 565 | * to have the prototypes here unconditionally. */ |
566 | extern void *malloc_or_warn(size_t size); | 566 | extern void *malloc_or_warn(size_t size) FAST_FUNC; |
567 | extern void *xmalloc(size_t size); | 567 | extern void *xmalloc(size_t size) FAST_FUNC; |
568 | extern void *xzalloc(size_t size); | 568 | extern void *xzalloc(size_t size) FAST_FUNC; |
569 | extern void *xrealloc(void *old, size_t size); | 569 | extern void *xrealloc(void *old, size_t size) FAST_FUNC; |
570 | 570 | ||
571 | extern ssize_t safe_read(int fd, void *buf, size_t count); | 571 | extern ssize_t safe_read(int fd, void *buf, size_t count) FAST_FUNC; |
572 | extern ssize_t nonblock_safe_read(int fd, void *buf, size_t count); | 572 | extern ssize_t nonblock_safe_read(int fd, void *buf, size_t count) FAST_FUNC; |
573 | // NB: will return short read on error, not -1, | 573 | // NB: will return short read on error, not -1, |
574 | // if some data was read before error occurred | 574 | // if some data was read before error occurred |
575 | extern ssize_t full_read(int fd, void *buf, size_t count); | 575 | extern ssize_t full_read(int fd, void *buf, size_t count) FAST_FUNC; |
576 | extern void xread(int fd, void *buf, size_t count); | 576 | extern void xread(int fd, void *buf, size_t count) FAST_FUNC; |
577 | extern unsigned char xread_char(int fd); | 577 | extern unsigned char xread_char(int fd) FAST_FUNC; |
578 | // Reads one line a-la fgets (but doesn't save terminating '\n'). | 578 | // Reads one line a-la fgets (but doesn't save terminating '\n'). |
579 | // Uses single full_read() call, works only on seekable streams. | 579 | // Uses single full_read() call, works only on seekable streams. |
580 | extern char *reads(int fd, char *buf, size_t count); | 580 | extern char *reads(int fd, char *buf, size_t count) FAST_FUNC; |
581 | // Reads one line a-la fgets (but doesn't save terminating '\n'). | 581 | // Reads one line a-la fgets (but doesn't save terminating '\n'). |
582 | // Reads byte-by-byte. Useful when it is important to not read ahead. | 582 | // Reads byte-by-byte. Useful when it is important to not read ahead. |
583 | // Bytes are appended to pfx (which must be malloced, or NULL). | 583 | // Bytes are appended to pfx (which must be malloced, or NULL). |
584 | extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p); | 584 | extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p) FAST_FUNC; |
585 | extern ssize_t read_close(int fd, void *buf, size_t maxsz); | 585 | extern ssize_t read_close(int fd, void *buf, size_t maxsz) FAST_FUNC; |
586 | extern ssize_t open_read_close(const char *filename, void *buf, size_t maxsz); | 586 | extern ssize_t open_read_close(const char *filename, void *buf, size_t maxsz) FAST_FUNC; |
587 | /* Returns NULL if file can't be opened */ | 587 | /* Returns NULL if file can't be opened */ |
588 | extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p); | 588 | extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC; |
589 | /* Never returns NULL */ | 589 | /* Never returns NULL */ |
590 | extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p); | 590 | extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC; |
591 | 591 | ||
592 | extern ssize_t safe_write(int fd, const void *buf, size_t count); | 592 | extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC; |
593 | // NB: will return short write on error, not -1, | 593 | // NB: will return short write on error, not -1, |
594 | // if some data was written before error occurred | 594 | // if some data was written before error occurred |
595 | extern ssize_t full_write(int fd, const void *buf, size_t count); | 595 | extern ssize_t full_write(int fd, const void *buf, size_t count) FAST_FUNC; |
596 | extern void xwrite(int fd, const void *buf, size_t count); | 596 | extern void xwrite(int fd, const void *buf, size_t count) FAST_FUNC; |
597 | extern void xopen_xwrite_close(const char* file, const char *str); | 597 | extern void xopen_xwrite_close(const char* file, const char *str) FAST_FUNC; |
598 | 598 | ||
599 | /* Reads and prints to stdout till eof, then closes FILE. Exits on error: */ | 599 | /* Reads and prints to stdout till eof, then closes FILE. Exits on error: */ |
600 | extern void xprint_and_close_file(FILE *file); | 600 | extern void xprint_and_close_file(FILE *file) FAST_FUNC; |
601 | /* Reads up to (and including) TERMINATING_STRING: */ | 601 | /* Reads up to (and including) TERMINATING_STRING: */ |
602 | extern char *xmalloc_fgets_str(FILE *file, const char *terminating_string); | 602 | extern char *xmalloc_fgets_str(FILE *file, const char *terminating_string) FAST_FUNC; |
603 | /* Chops off TERMINATING_STRING from the end: */ | 603 | /* Chops off TERMINATING_STRING from the end: */ |
604 | extern char *xmalloc_fgetline_str(FILE *file, const char *terminating_string); | 604 | extern char *xmalloc_fgetline_str(FILE *file, const char *terminating_string) FAST_FUNC; |
605 | /* Reads up to (and including) "\n" or NUL byte: */ | 605 | /* Reads up to (and including) "\n" or NUL byte: */ |
606 | extern char *xmalloc_fgets(FILE *file); | 606 | extern char *xmalloc_fgets(FILE *file) FAST_FUNC; |
607 | /* Chops off '\n' from the end, unlike fgets: */ | 607 | /* Chops off '\n' from the end, unlike fgets: */ |
608 | extern char *xmalloc_fgetline(FILE *file); | 608 | extern char *xmalloc_fgetline(FILE *file) FAST_FUNC; |
609 | extern char *bb_get_chunk_from_file(FILE *file, int *end); | 609 | extern char *bb_get_chunk_from_file(FILE *file, int *end) FAST_FUNC; |
610 | extern void die_if_ferror(FILE *file, const char *msg); | 610 | extern void die_if_ferror(FILE *file, const char *msg) FAST_FUNC; |
611 | extern void die_if_ferror_stdout(void); | 611 | extern void die_if_ferror_stdout(void) FAST_FUNC; |
612 | extern void xfflush_stdout(void); | 612 | extern void xfflush_stdout(void) FAST_FUNC; |
613 | extern void fflush_stdout_and_exit(int retval) ATTRIBUTE_NORETURN; | 613 | extern void fflush_stdout_and_exit(int retval) ATTRIBUTE_NORETURN FAST_FUNC; |
614 | extern int fclose_if_not_stdin(FILE *file); | 614 | extern int fclose_if_not_stdin(FILE *file) FAST_FUNC; |
615 | extern FILE *xfopen(const char *filename, const char *mode); | 615 | extern FILE *xfopen(const char *filename, const char *mode) FAST_FUNC; |
616 | /* Prints warning to stderr and returns NULL on failure: */ | 616 | /* Prints warning to stderr and returns NULL on failure: */ |
617 | extern FILE *fopen_or_warn(const char *filename, const char *mode); | 617 | extern FILE *fopen_or_warn(const char *filename, const char *mode) FAST_FUNC; |
618 | /* "Opens" stdin if filename is special, else just opens file: */ | 618 | /* "Opens" stdin if filename is special, else just opens file: */ |
619 | extern FILE *xfopen_stdin(const char *filename); | 619 | extern FILE *xfopen_stdin(const char *filename) FAST_FUNC; |
620 | extern FILE *fopen_or_warn_stdin(const char *filename); | 620 | extern FILE *fopen_or_warn_stdin(const char *filename) FAST_FUNC; |
621 | 621 | ||
622 | int bb_pstrcmp(const void *a, const void *b); | 622 | int bb_pstrcmp(const void *a, const void *b) /* not FAST_FUNC! */; |
623 | void qsort_string_vector(char **sv, unsigned count); | 623 | void qsort_string_vector(char **sv, unsigned count) FAST_FUNC; |
624 | 624 | ||
625 | /* Wrapper which restarts poll on EINTR or ENOMEM. | 625 | /* Wrapper which restarts poll on EINTR or ENOMEM. |
626 | * On other errors complains [perror("poll")] and returns. | 626 | * On other errors complains [perror("poll")] and returns. |
627 | * Warning! May take (much) longer than timeout_ms to return! | 627 | * Warning! May take (much) longer than timeout_ms to return! |
628 | * If this is a problem, use bare poll and open-code EINTR/ENOMEM handling */ | 628 | * If this is a problem, use bare poll and open-code EINTR/ENOMEM handling */ |
629 | int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout_ms); | 629 | int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout_ms) FAST_FUNC; |
630 | 630 | ||
631 | char *safe_gethostname(void); | 631 | char *safe_gethostname(void) FAST_FUNC; |
632 | 632 | ||
633 | /* Convert each alpha char in str to lower-case */ | 633 | /* Convert each alpha char in str to lower-case */ |
634 | char* str_tolower(char *str); | 634 | char* str_tolower(char *str) FAST_FUNC; |
635 | 635 | ||
636 | char *utoa(unsigned n); | 636 | char *utoa(unsigned n) FAST_FUNC; |
637 | char *itoa(int n); | 637 | char *itoa(int n) FAST_FUNC; |
638 | /* Returns a pointer past the formatted number, does NOT null-terminate */ | 638 | /* Returns a pointer past the formatted number, does NOT null-terminate */ |
639 | char *utoa_to_buf(unsigned n, char *buf, unsigned buflen); | 639 | char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC; |
640 | char *itoa_to_buf(int n, char *buf, unsigned buflen); | 640 | char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC; |
641 | /* Intelligent formatters of bignums */ | 641 | /* Intelligent formatters of bignums */ |
642 | void smart_ulltoa4(unsigned long long ul, char buf[5], const char *scale); | 642 | void smart_ulltoa4(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC; |
643 | void smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale); | 643 | void smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC; |
644 | //TODO: provide pointer to buf (avoid statics)? | 644 | //TODO: provide pointer to buf (avoid statics)? |
645 | const char *make_human_readable_str(unsigned long long size, | 645 | const char *make_human_readable_str(unsigned long long size, |
646 | unsigned long block_size, unsigned long display_unit); | 646 | unsigned long block_size, unsigned long display_unit) FAST_FUNC; |
647 | /* Put a string of hex bytes ("1b2e66fe"...), return advanced pointer */ | 647 | /* Put a string of hex bytes ("1b2e66fe"...), return advanced pointer */ |
648 | char *bin2hex(char *buf, const char *cp, int count); | 648 | char *bin2hex(char *buf, const char *cp, int count) FAST_FUNC; |
649 | 649 | ||
650 | /* Last element is marked by mult == 0 */ | 650 | /* Last element is marked by mult == 0 */ |
651 | struct suffix_mult { | 651 | struct suffix_mult { |
@@ -658,56 +658,56 @@ struct suffix_mult { | |||
658 | * in many places people want *non-negative* values, but store them | 658 | * in many places people want *non-negative* values, but store them |
659 | * in signed int. Therefore we need this one: | 659 | * in signed int. Therefore we need this one: |
660 | * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */ | 660 | * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */ |
661 | int xatoi_u(const char *numstr); | 661 | int xatoi_u(const char *numstr) FAST_FUNC; |
662 | /* Useful for reading port numbers */ | 662 | /* Useful for reading port numbers */ |
663 | uint16_t xatou16(const char *numstr); | 663 | uint16_t xatou16(const char *numstr) FAST_FUNC; |
664 | 664 | ||
665 | 665 | ||
666 | /* These parse entries in /etc/passwd and /etc/group. This is desirable | 666 | /* These parse entries in /etc/passwd and /etc/group. This is desirable |
667 | * for BusyBox since we want to avoid using the glibc NSS stuff, which | 667 | * for BusyBox since we want to avoid using the glibc NSS stuff, which |
668 | * increases target size and is often not needed on embedded systems. */ | 668 | * increases target size and is often not needed on embedded systems. */ |
669 | long xuname2uid(const char *name); | 669 | long xuname2uid(const char *name) FAST_FUNC; |
670 | long xgroup2gid(const char *name); | 670 | long xgroup2gid(const char *name) FAST_FUNC; |
671 | /* wrapper: allows string to contain numeric uid or gid */ | 671 | /* wrapper: allows string to contain numeric uid or gid */ |
672 | unsigned long get_ug_id(const char *s, long (*xname2id)(const char *)); | 672 | unsigned long get_ug_id(const char *s, long FAST_FUNC (*xname2id)(const char *)) FAST_FUNC; |
673 | /* from chpst. Does not die, returns 0 on failure */ | 673 | /* from chpst. Does not die, returns 0 on failure */ |
674 | struct bb_uidgid_t { | 674 | struct bb_uidgid_t { |
675 | uid_t uid; | 675 | uid_t uid; |
676 | gid_t gid; | 676 | gid_t gid; |
677 | }; | 677 | }; |
678 | /* always sets uid and gid */ | 678 | /* always sets uid and gid */ |
679 | int get_uidgid(struct bb_uidgid_t*, const char*, int numeric_ok); | 679 | int get_uidgid(struct bb_uidgid_t*, const char*, int numeric_ok) FAST_FUNC; |
680 | /* chown-like handling of "user[:[group]" */ | 680 | /* chown-like handling of "user[:[group]" */ |
681 | void parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_group); | 681 | void parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_group) FAST_FUNC; |
682 | /* bb_getpwuid, bb_getgrgid: | 682 | /* bb_getpwuid, bb_getgrgid: |
683 | * bb_getXXXid(buf, bufsz, id) - copy user/group name or id | 683 | * bb_getXXXid(buf, bufsz, id) - copy user/group name or id |
684 | * as a string to buf, return user/group name or NULL | 684 | * as a string to buf, return user/group name or NULL |
685 | * bb_getXXXid(NULL, 0, id) - return user/group name or NULL | 685 | * bb_getXXXid(NULL, 0, id) - return user/group name or NULL |
686 | * bb_getXXXid(NULL, -1, id) - return user/group name or exit | 686 | * bb_getXXXid(NULL, -1, id) - return user/group name or exit |
687 | */ | 687 | */ |
688 | char *bb_getpwuid(char *name, int bufsize, long uid); | 688 | char *bb_getpwuid(char *name, int bufsize, long uid) FAST_FUNC; |
689 | char *bb_getgrgid(char *group, int bufsize, long gid); | 689 | char *bb_getgrgid(char *group, int bufsize, long gid) FAST_FUNC; |
690 | /* versions which cache results (useful for ps, ls etc) */ | 690 | /* versions which cache results (useful for ps, ls etc) */ |
691 | const char* get_cached_username(uid_t uid); | 691 | const char* get_cached_username(uid_t uid) FAST_FUNC; |
692 | const char* get_cached_groupname(gid_t gid); | 692 | const char* get_cached_groupname(gid_t gid) FAST_FUNC; |
693 | void clear_username_cache(void); | 693 | void clear_username_cache(void) FAST_FUNC; |
694 | /* internally usernames are saved in fixed-sized char[] buffers */ | 694 | /* internally usernames are saved in fixed-sized char[] buffers */ |
695 | enum { USERNAME_MAX_SIZE = 16 - sizeof(int) }; | 695 | enum { USERNAME_MAX_SIZE = 16 - sizeof(int) }; |
696 | #if ENABLE_FEATURE_CHECK_NAMES | 696 | #if ENABLE_FEATURE_CHECK_NAMES |
697 | void die_if_bad_username(const char* name); | 697 | void die_if_bad_username(const char* name) FAST_FUNC; |
698 | #else | 698 | #else |
699 | #define die_if_bad_username(name) ((void)(name)) | 699 | #define die_if_bad_username(name) ((void)(name)) |
700 | #endif | 700 | #endif |
701 | 701 | ||
702 | int execable_file(const char *name); | 702 | int execable_file(const char *name) FAST_FUNC; |
703 | char *find_execable(const char *filename, char **PATHp); | 703 | char *find_execable(const char *filename, char **PATHp) FAST_FUNC; |
704 | int exists_execable(const char *filename); | 704 | int exists_execable(const char *filename) FAST_FUNC; |
705 | 705 | ||
706 | /* BB_EXECxx always execs (it's not doing NOFORK/NOEXEC stuff), | 706 | /* BB_EXECxx always execs (it's not doing NOFORK/NOEXEC stuff), |
707 | * but it may exec busybox and call applet instead of searching PATH. | 707 | * but it may exec busybox and call applet instead of searching PATH. |
708 | */ | 708 | */ |
709 | #if ENABLE_FEATURE_PREFER_APPLETS | 709 | #if ENABLE_FEATURE_PREFER_APPLETS |
710 | int bb_execvp(const char *file, char *const argv[]); | 710 | int bb_execvp(const char *file, char *const argv[]) FAST_FUNC; |
711 | #define BB_EXECVP(prog,cmd) bb_execvp(prog,cmd) | 711 | #define BB_EXECVP(prog,cmd) bb_execvp(prog,cmd) |
712 | #define BB_EXECLP(prog,cmd,...) \ | 712 | #define BB_EXECLP(prog,cmd,...) \ |
713 | execlp((find_applet_by_name(prog) >= 0) ? CONFIG_BUSYBOX_EXEC_PATH : prog, \ | 713 | execlp((find_applet_by_name(prog) >= 0) ? CONFIG_BUSYBOX_EXEC_PATH : prog, \ |
@@ -718,10 +718,10 @@ int bb_execvp(const char *file, char *const argv[]); | |||
718 | #endif | 718 | #endif |
719 | 719 | ||
720 | /* NOMMU friendy fork+exec */ | 720 | /* NOMMU friendy fork+exec */ |
721 | pid_t spawn(char **argv); | 721 | pid_t spawn(char **argv) FAST_FUNC; |
722 | pid_t xspawn(char **argv); | 722 | pid_t xspawn(char **argv) FAST_FUNC; |
723 | 723 | ||
724 | int safe_waitpid(int pid, int *wstat, int options); | 724 | int safe_waitpid(int pid, int *wstat, int options) FAST_FUNC; |
725 | /* Unlike waitpid, waits ONLY for one process. | 725 | /* Unlike waitpid, waits ONLY for one process. |
726 | * It's safe to pass negative 'pids' from failed [v]fork - | 726 | * It's safe to pass negative 'pids' from failed [v]fork - |
727 | * wait4pid will return -1 (and will not clobber [v]fork's errno). | 727 | * wait4pid will return -1 (and will not clobber [v]fork's errno). |
@@ -729,14 +729,14 @@ int safe_waitpid(int pid, int *wstat, int options); | |||
729 | * if (rc < 0) bb_perror_msg("%s", argv[0]); | 729 | * if (rc < 0) bb_perror_msg("%s", argv[0]); |
730 | * if (rc > 0) bb_error_msg("exit code: %d", rc); | 730 | * if (rc > 0) bb_error_msg("exit code: %d", rc); |
731 | */ | 731 | */ |
732 | int wait4pid(int pid); | 732 | int wait4pid(int pid) FAST_FUNC; |
733 | int wait_any_nohang(int *wstat); | 733 | int wait_any_nohang(int *wstat) FAST_FUNC; |
734 | #define wait_crashed(w) ((w) & 127) | 734 | #define wait_crashed(w) ((w) & 127) |
735 | #define wait_exitcode(w) ((w) >> 8) | 735 | #define wait_exitcode(w) ((w) >> 8) |
736 | #define wait_stopsig(w) ((w) >> 8) | 736 | #define wait_stopsig(w) ((w) >> 8) |
737 | #define wait_stopped(w) (((w) & 127) == 127) | 737 | #define wait_stopped(w) (((w) & 127) == 127) |
738 | /* wait4pid(spawn(argv)) + NOFORK/NOEXEC (if configured) */ | 738 | /* wait4pid(spawn(argv)) + NOFORK/NOEXEC (if configured) */ |
739 | int spawn_and_wait(char **argv); | 739 | int spawn_and_wait(char **argv) FAST_FUNC; |
740 | struct nofork_save_area { | 740 | struct nofork_save_area { |
741 | jmp_buf die_jmp; | 741 | jmp_buf die_jmp; |
742 | const char *applet_name; | 742 | const char *applet_name; |
@@ -745,11 +745,11 @@ struct nofork_save_area { | |||
745 | int die_sleep; | 745 | int die_sleep; |
746 | smallint saved; | 746 | smallint saved; |
747 | }; | 747 | }; |
748 | void save_nofork_data(struct nofork_save_area *save); | 748 | void save_nofork_data(struct nofork_save_area *save) FAST_FUNC; |
749 | void restore_nofork_data(struct nofork_save_area *save); | 749 | void restore_nofork_data(struct nofork_save_area *save) FAST_FUNC; |
750 | /* Does NOT check that applet is NOFORK, just blindly runs it */ | 750 | /* Does NOT check that applet is NOFORK, just blindly runs it */ |
751 | int run_nofork_applet(int applet_no, char **argv); | 751 | int run_nofork_applet(int applet_no, char **argv) FAST_FUNC; |
752 | int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **argv); | 752 | int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **argv) FAST_FUNC; |
753 | 753 | ||
754 | /* Helpers for daemonization. | 754 | /* Helpers for daemonization. |
755 | * | 755 | * |
@@ -781,26 +781,26 @@ enum { | |||
781 | DAEMON_ONLY_SANITIZE = 8, /* internal use */ | 781 | DAEMON_ONLY_SANITIZE = 8, /* internal use */ |
782 | }; | 782 | }; |
783 | #if BB_MMU | 783 | #if BB_MMU |
784 | void forkexit_or_rexec(void); | 784 | void forkexit_or_rexec(void) FAST_FUNC; |
785 | enum { re_execed = 0 }; | 785 | enum { re_execed = 0 }; |
786 | # define forkexit_or_rexec(argv) forkexit_or_rexec() | 786 | # define forkexit_or_rexec(argv) forkexit_or_rexec() |
787 | # define bb_daemonize_or_rexec(flags, argv) bb_daemonize_or_rexec(flags) | 787 | # define bb_daemonize_or_rexec(flags, argv) bb_daemonize_or_rexec(flags) |
788 | # define bb_daemonize(flags) bb_daemonize_or_rexec(flags, bogus) | 788 | # define bb_daemonize(flags) bb_daemonize_or_rexec(flags, bogus) |
789 | #else | 789 | #else |
790 | void re_exec(char **argv) ATTRIBUTE_NORETURN; | 790 | void re_exec(char **argv) ATTRIBUTE_NORETURN FAST_FUNC; |
791 | void forkexit_or_rexec(char **argv); | 791 | void forkexit_or_rexec(char **argv) FAST_FUNC; |
792 | extern bool re_execed; | 792 | extern bool re_execed; |
793 | int BUG_fork_is_unavailable_on_nommu(void); | 793 | int BUG_fork_is_unavailable_on_nommu(void) FAST_FUNC; |
794 | int BUG_daemon_is_unavailable_on_nommu(void); | 794 | int BUG_daemon_is_unavailable_on_nommu(void) FAST_FUNC; |
795 | void BUG_bb_daemonize_is_unavailable_on_nommu(void); | 795 | void BUG_bb_daemonize_is_unavailable_on_nommu(void) FAST_FUNC; |
796 | # define fork() BUG_fork_is_unavailable_on_nommu() | 796 | # define fork() BUG_fork_is_unavailable_on_nommu() |
797 | # define daemon(a,b) BUG_daemon_is_unavailable_on_nommu() | 797 | # define daemon(a,b) BUG_daemon_is_unavailable_on_nommu() |
798 | # define bb_daemonize(a) BUG_bb_daemonize_is_unavailable_on_nommu() | 798 | # define bb_daemonize(a) BUG_bb_daemonize_is_unavailable_on_nommu() |
799 | #endif | 799 | #endif |
800 | void bb_daemonize_or_rexec(int flags, char **argv); | 800 | void bb_daemonize_or_rexec(int flags, char **argv) FAST_FUNC; |
801 | void bb_sanitize_stdio(void); | 801 | void bb_sanitize_stdio(void) FAST_FUNC; |
802 | /* Clear dangerous stuff, set PATH. Return 1 if was run by different user. */ | 802 | /* Clear dangerous stuff, set PATH. Return 1 if was run by different user. */ |
803 | int sanitize_env_if_suid(void); | 803 | int sanitize_env_if_suid(void) FAST_FUNC; |
804 | 804 | ||
805 | 805 | ||
806 | extern const char *const bb_argv_dash[]; /* "-", NULL */ | 806 | extern const char *const bb_argv_dash[]; /* "-", NULL */ |
@@ -812,19 +812,19 @@ extern const char *opt_complementary; | |||
812 | extern const char *applet_long_options; | 812 | extern const char *applet_long_options; |
813 | #endif | 813 | #endif |
814 | extern uint32_t option_mask32; | 814 | extern uint32_t option_mask32; |
815 | extern uint32_t getopt32(char **argv, const char *applet_opts, ...); | 815 | extern uint32_t getopt32(char **argv, const char *applet_opts, ...) FAST_FUNC; |
816 | 816 | ||
817 | 817 | ||
818 | typedef struct llist_t { | 818 | typedef struct llist_t { |
819 | char *data; | 819 | char *data; |
820 | struct llist_t *link; | 820 | struct llist_t *link; |
821 | } llist_t; | 821 | } llist_t; |
822 | void llist_add_to(llist_t **old_head, void *data); | 822 | void llist_add_to(llist_t **old_head, void *data) FAST_FUNC; |
823 | void llist_add_to_end(llist_t **list_head, void *data); | 823 | void llist_add_to_end(llist_t **list_head, void *data) FAST_FUNC; |
824 | void *llist_pop(llist_t **elm); | 824 | void *llist_pop(llist_t **elm) FAST_FUNC; |
825 | void llist_unlink(llist_t **head, llist_t *elm); | 825 | void llist_unlink(llist_t **head, llist_t *elm) FAST_FUNC; |
826 | void llist_free(llist_t *elm, void (*freeit)(void *data)); | 826 | void llist_free(llist_t *elm, void (*freeit)(void *data)) FAST_FUNC; |
827 | llist_t *llist_rev(llist_t *list); | 827 | llist_t *llist_rev(llist_t *list) FAST_FUNC; |
828 | /* BTW, surprisingly, changing API to | 828 | /* BTW, surprisingly, changing API to |
829 | * llist_t *llist_add_to(llist_t *old_head, void *data) | 829 | * llist_t *llist_add_to(llist_t *old_head, void *data) |
830 | * etc does not result in smaller code... */ | 830 | * etc does not result in smaller code... */ |
@@ -834,7 +834,7 @@ llist_t *llist_rev(llist_t *list); | |||
834 | #if ENABLE_FEATURE_PIDFILE || defined(WANT_PIDFILE) | 834 | #if ENABLE_FEATURE_PIDFILE || defined(WANT_PIDFILE) |
835 | /* True only if we created pidfile which is *file*, not /dev/null etc */ | 835 | /* True only if we created pidfile which is *file*, not /dev/null etc */ |
836 | extern smallint wrote_pidfile; | 836 | extern smallint wrote_pidfile; |
837 | void write_pidfile(const char *path); | 837 | void write_pidfile(const char *path) FAST_FUNC; |
838 | #define remove_pidfile(path) do { if (wrote_pidfile) unlink(path); } while (0) | 838 | #define remove_pidfile(path) do { if (wrote_pidfile) unlink(path); } while (0) |
839 | #else | 839 | #else |
840 | enum { wrote_pidfile = 0 }; | 840 | enum { wrote_pidfile = 0 }; |
@@ -853,20 +853,20 @@ extern smallint logmode; | |||
853 | extern int die_sleep; | 853 | extern int die_sleep; |
854 | extern int xfunc_error_retval; | 854 | extern int xfunc_error_retval; |
855 | extern jmp_buf die_jmp; | 855 | extern jmp_buf die_jmp; |
856 | extern void xfunc_die(void) ATTRIBUTE_NORETURN; | 856 | extern void xfunc_die(void) ATTRIBUTE_NORETURN FAST_FUNC; |
857 | extern void bb_show_usage(void) ATTRIBUTE_NORETURN; | 857 | extern void bb_show_usage(void) ATTRIBUTE_NORETURN FAST_FUNC; |
858 | extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); | 858 | extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; |
859 | extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); | 859 | extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC; |
860 | extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); | 860 | extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; |
861 | extern void bb_simple_perror_msg(const char *s); | 861 | extern void bb_simple_perror_msg(const char *s) FAST_FUNC; |
862 | extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); | 862 | extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC; |
863 | extern void bb_simple_perror_msg_and_die(const char *s) __attribute__ ((noreturn)); | 863 | extern void bb_simple_perror_msg_and_die(const char *s) __attribute__ ((noreturn)) FAST_FUNC; |
864 | extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); | 864 | extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; |
865 | extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); | 865 | extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC; |
866 | extern void bb_perror_nomsg_and_die(void) ATTRIBUTE_NORETURN; | 866 | extern void bb_perror_nomsg_and_die(void) ATTRIBUTE_NORETURN FAST_FUNC; |
867 | extern void bb_perror_nomsg(void); | 867 | extern void bb_perror_nomsg(void) FAST_FUNC; |
868 | extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); | 868 | extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; |
869 | extern void bb_verror_msg(const char *s, va_list p, const char *strerr); | 869 | extern void bb_verror_msg(const char *s, va_list p, const char *strerr) FAST_FUNC; |
870 | 870 | ||
871 | /* We need to export XXX_main from libbusybox | 871 | /* We need to export XXX_main from libbusybox |
872 | * only if we build "individual" binaries | 872 | * only if we build "individual" binaries |
@@ -893,15 +893,15 @@ int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | |||
893 | int bbunpack(char **argv, | 893 | int bbunpack(char **argv, |
894 | char* (*make_new_name)(char *filename), | 894 | char* (*make_new_name)(char *filename), |
895 | USE_DESKTOP(long long) int (*unpacker)(void) | 895 | USE_DESKTOP(long long) int (*unpacker)(void) |
896 | ); | 896 | ) FAST_FUNC; |
897 | #if ENABLE_ROUTE | 897 | #if ENABLE_ROUTE |
898 | void bb_displayroutes(int noresolve, int netstatfmt); | 898 | void bb_displayroutes(int noresolve, int netstatfmt) FAST_FUNC; |
899 | #endif | 899 | #endif |
900 | 900 | ||
901 | 901 | ||
902 | /* Networking */ | 902 | /* Networking */ |
903 | int create_icmp_socket(void); | 903 | int create_icmp_socket(void) FAST_FUNC; |
904 | int create_icmp6_socket(void); | 904 | int create_icmp6_socket(void) FAST_FUNC; |
905 | /* interface.c */ | 905 | /* interface.c */ |
906 | /* This structure defines protocol families and their handlers. */ | 906 | /* This structure defines protocol families and their handlers. */ |
907 | struct aftype { | 907 | struct aftype { |
@@ -909,15 +909,14 @@ struct aftype { | |||
909 | const char *title; | 909 | const char *title; |
910 | int af; | 910 | int af; |
911 | int alen; | 911 | int alen; |
912 | char *(*print) (unsigned char *); | 912 | char* FAST_FUNC (*print)(unsigned char *); |
913 | const char *(*sprint) (struct sockaddr *, int numeric); | 913 | const char* FAST_FUNC (*sprint)(struct sockaddr *, int numeric); |
914 | int (*input) (/*int type,*/ const char *bufp, struct sockaddr *); | 914 | int FAST_FUNC (*input)(/*int type,*/ const char *bufp, struct sockaddr *); |
915 | void (*herror) (char *text); | 915 | void FAST_FUNC (*herror)(char *text); |
916 | int (*rprint) (int options); | 916 | int FAST_FUNC (*rprint)(int options); |
917 | int (*rinput) (int typ, int ext, char **argv); | 917 | int FAST_FUNC (*rinput)(int typ, int ext, char **argv); |
918 | |||
919 | /* may modify src */ | 918 | /* may modify src */ |
920 | int (*getmask) (char *src, struct sockaddr * mask, char *name); | 919 | int FAST_FUNC (*getmask)(char *src, struct sockaddr *mask, char *name); |
921 | }; | 920 | }; |
922 | /* This structure defines hardware protocols and their handlers. */ | 921 | /* This structure defines hardware protocols and their handlers. */ |
923 | struct hwtype { | 922 | struct hwtype { |
@@ -925,95 +924,95 @@ struct hwtype { | |||
925 | const char *title; | 924 | const char *title; |
926 | int type; | 925 | int type; |
927 | int alen; | 926 | int alen; |
928 | char *(*print) (unsigned char *); | 927 | char* FAST_FUNC (*print)(unsigned char *); |
929 | int (*input) (const char *, struct sockaddr *); | 928 | int FAST_FUNC (*input)(const char *, struct sockaddr *); |
930 | int (*activate) (int fd); | 929 | int FAST_FUNC (*activate)(int fd); |
931 | int suppress_null_addr; | 930 | int suppress_null_addr; |
932 | }; | 931 | }; |
933 | extern smallint interface_opt_a; | 932 | extern smallint interface_opt_a; |
934 | int display_interfaces(char *ifname); | 933 | int display_interfaces(char *ifname) FAST_FUNC; |
935 | #if ENABLE_FEATURE_HWIB | 934 | #if ENABLE_FEATURE_HWIB |
936 | int in_ib(const char *bufp, struct sockaddr *sap); | 935 | int in_ib(const char *bufp, struct sockaddr *sap) FAST_FUNC; |
937 | #else | 936 | #else |
938 | #define in_ib(a, b) 1 /* fail */ | 937 | #define in_ib(a, b) 1 /* fail */ |
939 | #endif | 938 | #endif |
940 | const struct aftype *get_aftype(const char *name); | 939 | const struct aftype *get_aftype(const char *name) FAST_FUNC; |
941 | const struct hwtype *get_hwtype(const char *name); | 940 | const struct hwtype *get_hwtype(const char *name) FAST_FUNC; |
942 | const struct hwtype *get_hwntype(int type); | 941 | const struct hwtype *get_hwntype(int type) FAST_FUNC; |
943 | 942 | ||
944 | 943 | ||
945 | #ifndef BUILD_INDIVIDUAL | 944 | #ifndef BUILD_INDIVIDUAL |
946 | extern int find_applet_by_name(const char *name); | 945 | extern int find_applet_by_name(const char *name) FAST_FUNC; |
947 | /* Returns only if applet is not found. */ | 946 | /* Returns only if applet is not found. */ |
948 | extern void run_applet_and_exit(const char *name, char **argv); | 947 | extern void run_applet_and_exit(const char *name, char **argv) FAST_FUNC; |
949 | extern void run_applet_no_and_exit(int a, char **argv) ATTRIBUTE_NORETURN; | 948 | extern void run_applet_no_and_exit(int a, char **argv) ATTRIBUTE_NORETURN FAST_FUNC; |
950 | #endif | 949 | #endif |
951 | 950 | ||
952 | #ifdef HAVE_MNTENT_H | 951 | #ifdef HAVE_MNTENT_H |
953 | extern int match_fstype(const struct mntent *mt, const char *fstypes); | 952 | extern int match_fstype(const struct mntent *mt, const char *fstypes) FAST_FUNC; |
954 | extern struct mntent *find_mount_point(const char *name, const char *table); | 953 | extern struct mntent *find_mount_point(const char *name, const char *table) FAST_FUNC; |
955 | #endif | 954 | #endif |
956 | extern void erase_mtab(const char * name); | 955 | extern void erase_mtab(const char * name) FAST_FUNC; |
957 | extern unsigned int tty_baud_to_value(speed_t speed); | 956 | extern unsigned int tty_baud_to_value(speed_t speed) FAST_FUNC; |
958 | extern speed_t tty_value_to_baud(unsigned int value); | 957 | extern speed_t tty_value_to_baud(unsigned int value) FAST_FUNC; |
959 | extern void bb_warn_ignoring_args(int n); | 958 | extern void bb_warn_ignoring_args(int n) FAST_FUNC; |
960 | 959 | ||
961 | extern int get_linux_version_code(void); | 960 | extern int get_linux_version_code(void) FAST_FUNC; |
962 | 961 | ||
963 | extern char *query_loop(const char *device); | 962 | extern char *query_loop(const char *device) FAST_FUNC; |
964 | extern int del_loop(const char *device); | 963 | extern int del_loop(const char *device) FAST_FUNC; |
965 | /* If *devname is not NULL, use that name, otherwise try to find free one, | 964 | /* If *devname is not NULL, use that name, otherwise try to find free one, |
966 | * malloc and return it in *devname. | 965 | * malloc and return it in *devname. |
967 | * return value: 1: read-only loopdev was setup, 0: rw, < 0: error */ | 966 | * return value: 1: read-only loopdev was setup, 0: rw, < 0: error */ |
968 | extern int set_loop(char **devname, const char *file, unsigned long long offset); | 967 | extern int set_loop(char **devname, const char *file, unsigned long long offset) FAST_FUNC; |
969 | 968 | ||
970 | 969 | ||
971 | //TODO: pass buf pointer or return allocated buf (avoid statics)? | 970 | //TODO: pass buf pointer or return allocated buf (avoid statics)? |
972 | char *bb_askpass(int timeout, const char * prompt); | 971 | char *bb_askpass(int timeout, const char * prompt) FAST_FUNC; |
973 | int bb_ask_confirmation(void); | 972 | int bb_ask_confirmation(void) FAST_FUNC; |
974 | 973 | ||
975 | extern int bb_parse_mode(const char* s, mode_t* theMode); | 974 | extern int bb_parse_mode(const char* s, mode_t* theMode) FAST_FUNC; |
976 | 975 | ||
977 | /* Concatenate path and filename to new allocated buffer. | 976 | /* Concatenate path and filename to new allocated buffer. |
978 | * Add "/" only as needed (no duplicate "//" are produced). | 977 | * Add "/" only as needed (no duplicate "//" are produced). |
979 | * If path is NULL, it is assumed to be "/". | 978 | * If path is NULL, it is assumed to be "/". |
980 | * filename should not be NULL. */ | 979 | * filename should not be NULL. */ |
981 | char *concat_path_file(const char *path, const char *filename); | 980 | char *concat_path_file(const char *path, const char *filename) FAST_FUNC; |
982 | char *concat_subpath_file(const char *path, const char *filename); | 981 | char *concat_subpath_file(const char *path, const char *filename) FAST_FUNC; |
983 | const char *bb_basename(const char *name); | 982 | const char *bb_basename(const char *name) FAST_FUNC; |
984 | /* NB: can violate const-ness (similarly to strchr) */ | 983 | /* NB: can violate const-ness (similarly to strchr) */ |
985 | char *last_char_is(const char *s, int c); | 984 | char *last_char_is(const char *s, int c) FAST_FUNC; |
986 | 985 | ||
987 | 986 | ||
988 | USE_DESKTOP(long long) int uncompress(int fd_in, int fd_out); | 987 | USE_DESKTOP(long long) int uncompress(int fd_in, int fd_out) FAST_FUNC; |
989 | int inflate(int in, int out); | 988 | int inflate(int in, int out) FAST_FUNC; |
990 | 989 | ||
991 | 990 | ||
992 | int bb_make_directory(char *path, long mode, int flags); | 991 | int bb_make_directory(char *path, long mode, int flags) FAST_FUNC; |
993 | 992 | ||
994 | int get_signum(const char *name); | 993 | int get_signum(const char *name) FAST_FUNC; |
995 | const char *get_signame(int number); | 994 | const char *get_signame(int number) FAST_FUNC; |
996 | void print_signames(void); | 995 | void print_signames(void) FAST_FUNC; |
997 | 996 | ||
998 | char *bb_simplify_path(const char *path); | 997 | char *bb_simplify_path(const char *path) FAST_FUNC; |
999 | 998 | ||
1000 | #define FAIL_DELAY 3 | 999 | #define FAIL_DELAY 3 |
1001 | extern void bb_do_delay(int seconds); | 1000 | extern void bb_do_delay(int seconds) FAST_FUNC; |
1002 | extern void change_identity(const struct passwd *pw); | 1001 | extern void change_identity(const struct passwd *pw) FAST_FUNC; |
1003 | extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) ATTRIBUTE_NORETURN; | 1002 | extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) ATTRIBUTE_NORETURN FAST_FUNC; |
1004 | extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args); | 1003 | extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) FAST_FUNC; |
1005 | #if ENABLE_SELINUX | 1004 | #if ENABLE_SELINUX |
1006 | extern void renew_current_security_context(void); | 1005 | extern void renew_current_security_context(void) FAST_FUNC; |
1007 | extern void set_current_security_context(security_context_t sid); | 1006 | extern void set_current_security_context(security_context_t sid) FAST_FUNC; |
1008 | extern context_t set_security_context_component(security_context_t cur_context, | 1007 | extern context_t set_security_context_component(security_context_t cur_context, |
1009 | char *user, char *role, char *type, char *range); | 1008 | char *user, char *role, char *type, char *range) FAST_FUNC; |
1010 | extern void setfscreatecon_or_die(security_context_t scontext); | 1009 | extern void setfscreatecon_or_die(security_context_t scontext) FAST_FUNC; |
1011 | extern void selinux_preserve_fcontext(int fdesc); | 1010 | extern void selinux_preserve_fcontext(int fdesc) FAST_FUNC; |
1012 | #else | 1011 | #else |
1013 | #define selinux_preserve_fcontext(fdesc) ((void)0) | 1012 | #define selinux_preserve_fcontext(fdesc) ((void)0) |
1014 | #endif | 1013 | #endif |
1015 | extern void selinux_or_die(void); | 1014 | extern void selinux_or_die(void) FAST_FUNC; |
1016 | extern int restricted_shell(const char *shell); | 1015 | extern int restricted_shell(const char *shell) FAST_FUNC; |
1017 | 1016 | ||
1018 | /* setup_environment: | 1017 | /* setup_environment: |
1019 | * if clear_env = 1: cd(pw->pw_dir), clear environment, then set | 1018 | * if clear_env = 1: cd(pw->pw_dir), clear environment, then set |
@@ -1029,14 +1028,14 @@ extern int restricted_shell(const char *shell); | |||
1029 | * SHELL=shell | 1028 | * SHELL=shell |
1030 | * else does nothing | 1029 | * else does nothing |
1031 | */ | 1030 | */ |
1032 | extern void setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw); | 1031 | extern void setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw) FAST_FUNC; |
1033 | extern int correct_password(const struct passwd *pw); | 1032 | extern int correct_password(const struct passwd *pw) FAST_FUNC; |
1034 | /* Returns a malloced string */ | 1033 | /* Returns a malloced string */ |
1035 | #if !ENABLE_USE_BB_CRYPT | 1034 | #if !ENABLE_USE_BB_CRYPT |
1036 | #define pw_encrypt(clear, salt, cleanup) pw_encrypt(clear, salt) | 1035 | #define pw_encrypt(clear, salt, cleanup) pw_encrypt(clear, salt) |
1037 | #endif | 1036 | #endif |
1038 | extern char *pw_encrypt(const char *clear, const char *salt, int cleanup); | 1037 | extern char *pw_encrypt(const char *clear, const char *salt, int cleanup) FAST_FUNC; |
1039 | extern int obscure(const char *old, const char *newval, const struct passwd *pwdp); | 1038 | extern int obscure(const char *old, const char *newval, const struct passwd *pwdp) FAST_FUNC; |
1040 | /* rnd is additional random input. New one is returned. | 1039 | /* rnd is additional random input. New one is returned. |
1041 | * Useful if you call crypt_make_salt many times in a row: | 1040 | * Useful if you call crypt_make_salt many times in a row: |
1042 | * rnd = crypt_make_salt(buf1, 4, 0); | 1041 | * rnd = crypt_make_salt(buf1, 4, 0); |
@@ -1044,44 +1043,44 @@ extern int obscure(const char *old, const char *newval, const struct passwd *pwd | |||
1044 | * rnd = crypt_make_salt(buf3, 4, rnd); | 1043 | * rnd = crypt_make_salt(buf3, 4, rnd); |
1045 | * (otherwise we risk having same salt generated) | 1044 | * (otherwise we risk having same salt generated) |
1046 | */ | 1045 | */ |
1047 | extern int crypt_make_salt(char *p, int cnt, int rnd); | 1046 | extern int crypt_make_salt(char *p, int cnt, int rnd) FAST_FUNC; |
1048 | /* Returns number of lines changed, or -1 on error */ | 1047 | /* Returns number of lines changed, or -1 on error */ |
1049 | extern int update_passwd(const char *filename, const char *username, | 1048 | extern int update_passwd(const char *filename, const char *username, |
1050 | const char *new_pw); | 1049 | const char *new_pw) FAST_FUNC; |
1051 | 1050 | ||
1052 | int index_in_str_array(const char *const string_array[], const char *key); | 1051 | int index_in_str_array(const char *const string_array[], const char *key) FAST_FUNC; |
1053 | int index_in_strings(const char *strings, const char *key); | 1052 | int index_in_strings(const char *strings, const char *key) FAST_FUNC; |
1054 | int index_in_substr_array(const char *const string_array[], const char *key); | 1053 | int index_in_substr_array(const char *const string_array[], const char *key) FAST_FUNC; |
1055 | int index_in_substrings(const char *strings, const char *key); | 1054 | int index_in_substrings(const char *strings, const char *key) FAST_FUNC; |
1056 | const char *nth_string(const char *strings, int n); | 1055 | const char *nth_string(const char *strings, int n) FAST_FUNC; |
1057 | 1056 | ||
1058 | extern void print_login_issue(const char *issue_file, const char *tty); | 1057 | extern void print_login_issue(const char *issue_file, const char *tty) FAST_FUNC; |
1059 | extern void print_login_prompt(void); | 1058 | extern void print_login_prompt(void) FAST_FUNC; |
1060 | 1059 | ||
1061 | /* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */ | 1060 | /* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */ |
1062 | int get_terminal_width_height(int fd, unsigned *width, unsigned *height); | 1061 | int get_terminal_width_height(int fd, unsigned *width, unsigned *height) FAST_FUNC; |
1063 | 1062 | ||
1064 | /* NB: "unsigned request" is crucial! "int request" will break some arches! */ | 1063 | /* NB: "unsigned request" is crucial! "int request" will break some arches! */ |
1065 | int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))); | 1064 | int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC; |
1066 | int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))); | 1065 | int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC; |
1067 | #if ENABLE_IOCTL_HEX2STR_ERROR | 1066 | #if ENABLE_IOCTL_HEX2STR_ERROR |
1068 | int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name); | 1067 | int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC; |
1069 | int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name); | 1068 | int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC; |
1070 | #define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp,#request) | 1069 | #define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp,#request) |
1071 | #define xioctl(fd,request,argp) bb_xioctl(fd,request,argp,#request) | 1070 | #define xioctl(fd,request,argp) bb_xioctl(fd,request,argp,#request) |
1072 | #else | 1071 | #else |
1073 | int bb_ioctl_or_warn(int fd, unsigned request, void *argp); | 1072 | int bb_ioctl_or_warn(int fd, unsigned request, void *argp) FAST_FUNC; |
1074 | int bb_xioctl(int fd, unsigned request, void *argp); | 1073 | int bb_xioctl(int fd, unsigned request, void *argp) FAST_FUNC; |
1075 | #define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp) | 1074 | #define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp) |
1076 | #define xioctl(fd,request,argp) bb_xioctl(fd,request,argp) | 1075 | #define xioctl(fd,request,argp) bb_xioctl(fd,request,argp) |
1077 | #endif | 1076 | #endif |
1078 | 1077 | ||
1079 | char *is_in_ino_dev_hashtable(const struct stat *statbuf); | 1078 | char *is_in_ino_dev_hashtable(const struct stat *statbuf) FAST_FUNC; |
1080 | void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name); | 1079 | void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) FAST_FUNC; |
1081 | void reset_ino_dev_hashtable(void); | 1080 | void reset_ino_dev_hashtable(void) FAST_FUNC; |
1082 | #ifdef __GLIBC__ | 1081 | #ifdef __GLIBC__ |
1083 | /* At least glibc has horrendously large inline for this, so wrap it */ | 1082 | /* At least glibc has horrendously large inline for this, so wrap it */ |
1084 | unsigned long long bb_makedev(unsigned int major, unsigned int minor); | 1083 | unsigned long long bb_makedev(unsigned int major, unsigned int minor) FAST_FUNC; |
1085 | #undef makedev | 1084 | #undef makedev |
1086 | #define makedev(a,b) bb_makedev(a,b) | 1085 | #define makedev(a,b) bb_makedev(a,b) |
1087 | #endif | 1086 | #endif |
@@ -1113,15 +1112,15 @@ enum { | |||
1113 | WITH_PATH_LOOKUP = 0x20, | 1112 | WITH_PATH_LOOKUP = 0x20, |
1114 | FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION, | 1113 | FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION, |
1115 | }; | 1114 | }; |
1116 | line_input_t *new_line_input_t(int flags); | 1115 | line_input_t *new_line_input_t(int flags) FAST_FUNC; |
1117 | /* Returns: | 1116 | /* Returns: |
1118 | * -1 on read errors or EOF, or on bare Ctrl-D, | 1117 | * -1 on read errors or EOF, or on bare Ctrl-D, |
1119 | * 0 on ctrl-C (the line entered is still returned in 'command'), | 1118 | * 0 on ctrl-C (the line entered is still returned in 'command'), |
1120 | * >0 length of input string, including terminating '\n' | 1119 | * >0 length of input string, including terminating '\n' |
1121 | */ | 1120 | */ |
1122 | int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state); | 1121 | int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state) FAST_FUNC; |
1123 | #else | 1122 | #else |
1124 | int read_line_input(const char* prompt, char* command, int maxsize); | 1123 | int read_line_input(const char* prompt, char* command, int maxsize) FAST_FUNC; |
1125 | #define read_line_input(prompt, command, maxsize, state) \ | 1124 | #define read_line_input(prompt, command, maxsize, state) \ |
1126 | read_line_input(prompt, command, maxsize) | 1125 | read_line_input(prompt, command, maxsize) |
1127 | #endif | 1126 | #endif |
@@ -1197,28 +1196,28 @@ enum { | |||
1197 | | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME | 1196 | | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME |
1198 | | PSSCAN_TTY, | 1197 | | PSSCAN_TTY, |
1199 | }; | 1198 | }; |
1200 | //procps_status_t* alloc_procps_scan(void); | 1199 | //procps_status_t* alloc_procps_scan(void) FAST_FUNC; |
1201 | void free_procps_scan(procps_status_t* sp); | 1200 | void free_procps_scan(procps_status_t* sp) FAST_FUNC; |
1202 | procps_status_t* procps_scan(procps_status_t* sp, int flags); | 1201 | procps_status_t* procps_scan(procps_status_t* sp, int flags) FAST_FUNC; |
1203 | /* Format cmdline (up to col chars) into char buf[col+1] */ | 1202 | /* Format cmdline (up to col chars) into char buf[col+1] */ |
1204 | /* Puts [comm] if cmdline is empty (-> process is a kernel thread) */ | 1203 | /* Puts [comm] if cmdline is empty (-> process is a kernel thread) */ |
1205 | void read_cmdline(char *buf, int col, unsigned pid, const char *comm); | 1204 | void read_cmdline(char *buf, int col, unsigned pid, const char *comm) FAST_FUNC; |
1206 | pid_t *find_pid_by_name(const char* procName); | 1205 | pid_t *find_pid_by_name(const char* procName) FAST_FUNC; |
1207 | pid_t *pidlist_reverse(pid_t *pidList); | 1206 | pid_t *pidlist_reverse(pid_t *pidList) FAST_FUNC; |
1208 | 1207 | ||
1209 | 1208 | ||
1210 | extern const char bb_uuenc_tbl_base64[]; | 1209 | extern const char bb_uuenc_tbl_base64[]; |
1211 | extern const char bb_uuenc_tbl_std[]; | 1210 | extern const char bb_uuenc_tbl_std[]; |
1212 | void bb_uuencode(char *store, const void *s, int length, const char *tbl); | 1211 | void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; |
1213 | 1212 | ||
1214 | typedef struct sha1_ctx_t { | 1213 | typedef struct sha1_ctx_t { |
1215 | uint32_t count[2]; | 1214 | uint32_t count[2]; |
1216 | uint32_t hash[5]; | 1215 | uint32_t hash[5]; |
1217 | uint32_t wbuf[16]; | 1216 | uint32_t wbuf[16]; |
1218 | } sha1_ctx_t; | 1217 | } sha1_ctx_t; |
1219 | void sha1_begin(sha1_ctx_t *ctx); | 1218 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; |
1220 | void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx); | 1219 | void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC; |
1221 | void *sha1_end(void *resbuf, sha1_ctx_t *ctx); | 1220 | void *sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC; |
1222 | 1221 | ||
1223 | typedef struct md5_ctx_t { | 1222 | typedef struct md5_ctx_t { |
1224 | uint32_t A; | 1223 | uint32_t A; |
@@ -1229,11 +1228,19 @@ typedef struct md5_ctx_t { | |||
1229 | uint32_t buflen; | 1228 | uint32_t buflen; |
1230 | char buffer[128]; | 1229 | char buffer[128]; |
1231 | } md5_ctx_t; | 1230 | } md5_ctx_t; |
1232 | void md5_begin(md5_ctx_t *ctx); | 1231 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; |
1233 | void md5_hash(const void *data, size_t length, md5_ctx_t *ctx); | 1232 | void md5_hash(const void *data, size_t length, md5_ctx_t *ctx) FAST_FUNC; |
1234 | void *md5_end(void *resbuf, md5_ctx_t *ctx); | 1233 | void *md5_end(void *resbuf, md5_ctx_t *ctx) FAST_FUNC; |
1234 | |||
1235 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; | ||
1235 | 1236 | ||
1236 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian); | 1237 | typedef struct masks_labels_t { |
1238 | const char *labels; | ||
1239 | const int masks[]; | ||
1240 | } masks_labels_t; | ||
1241 | int print_flags_separated(const int *masks, const char *labels, | ||
1242 | int flags, const char *separator) FAST_FUNC; | ||
1243 | int print_flags(const masks_labels_t *ml, int flags) FAST_FUNC; | ||
1237 | 1244 | ||
1238 | 1245 | ||
1239 | extern const char *applet_name; | 1246 | extern const char *applet_name; |
@@ -1305,15 +1312,6 @@ extern const char bb_default_login_shell[]; | |||
1305 | /* "sh" */ | 1312 | /* "sh" */ |
1306 | #define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6) | 1313 | #define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6) |
1307 | 1314 | ||
1308 | typedef struct masks_labels_t { | ||
1309 | const char *labels; | ||
1310 | const int masks[]; | ||
1311 | } masks_labels_t; | ||
1312 | |||
1313 | int print_flags_separated(const int *masks, const char *labels, | ||
1314 | int flags, const char *separator); | ||
1315 | extern int print_flags(const masks_labels_t *ml, int flags); | ||
1316 | |||
1317 | #if ENABLE_FEATURE_DEVFS | 1315 | #if ENABLE_FEATURE_DEVFS |
1318 | # define CURRENT_VC "/dev/vc/0" | 1316 | # define CURRENT_VC "/dev/vc/0" |
1319 | # define VC_1 "/dev/vc/1" | 1317 | # define VC_1 "/dev/vc/1" |
diff --git a/include/platform.h b/include/platform.h index cdc1151ad..8d6ed9a3e 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -97,6 +97,13 @@ | |||
97 | # endif | 97 | # endif |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #if __GNUC_PREREQ(3,0) && defined(i386) | ||
101 | /* || defined(__x86_64__)? */ | ||
102 | # define FAST_FUNC __attribute__((regparm(3))) | ||
103 | #else | ||
104 | # define FAST_FUNC | ||
105 | #endif | ||
106 | |||
100 | /* ---- Endian Detection ------------------------------------ */ | 107 | /* ---- Endian Detection ------------------------------------ */ |
101 | 108 | ||
102 | #if (defined __digital__ && defined __unix__) | 109 | #if (defined __digital__ && defined __unix__) |
diff --git a/include/rtc_.h b/include/rtc_.h index b8e4de895..2e990581f 100644 --- a/include/rtc_.h +++ b/include/rtc_.h | |||
@@ -13,9 +13,9 @@ | |||
13 | # pragma GCC visibility push(hidden) | 13 | # pragma GCC visibility push(hidden) |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | extern int rtc_adjtime_is_utc(void); | 16 | extern int rtc_adjtime_is_utc(void) FAST_FUNC; |
17 | extern int rtc_xopen(const char **default_rtc, int flags); | 17 | extern int rtc_xopen(const char **default_rtc, int flags) FAST_FUNC; |
18 | extern time_t rtc_read_time(int fd, int utc); | 18 | extern time_t rtc_read_time(int fd, int utc) FAST_FUNC; |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * Everything below this point has been copied from linux/rtc.h | 21 | * Everything below this point has been copied from linux/rtc.h |
diff --git a/include/unarchive.h b/include/unarchive.h index a6b047794..721f879a4 100644 --- a/include/unarchive.h +++ b/include/unarchive.h | |||
@@ -31,7 +31,7 @@ typedef struct file_header_t { | |||
31 | 31 | ||
32 | typedef struct archive_handle_t { | 32 | typedef struct archive_handle_t { |
33 | /* define if the header and data component should be processed */ | 33 | /* define if the header and data component should be processed */ |
34 | char (*filter)(struct archive_handle_t *); | 34 | char FAST_FUNC (*filter)(struct archive_handle_t *); |
35 | llist_t *accept; | 35 | llist_t *accept; |
36 | /* List of files that have been rejected */ | 36 | /* List of files that have been rejected */ |
37 | llist_t *reject; | 37 | llist_t *reject; |
@@ -42,13 +42,13 @@ typedef struct archive_handle_t { | |||
42 | file_header_t *file_header; | 42 | file_header_t *file_header; |
43 | 43 | ||
44 | /* process the header component, e.g. tar -t */ | 44 | /* process the header component, e.g. tar -t */ |
45 | void (*action_header)(const file_header_t *); | 45 | void FAST_FUNC (*action_header)(const file_header_t *); |
46 | 46 | ||
47 | /* process the data component, e.g. extract to filesystem */ | 47 | /* process the data component, e.g. extract to filesystem */ |
48 | void (*action_data)(struct archive_handle_t *); | 48 | void FAST_FUNC (*action_data)(struct archive_handle_t *); |
49 | 49 | ||
50 | /* How to process any sub archive, e.g. get_header_tar_gz */ | 50 | /* How to process any sub archive, e.g. get_header_tar_gz */ |
51 | char (*action_data_subarchive)(struct archive_handle_t *); | 51 | char FAST_FUNC (*action_data_subarchive)(struct archive_handle_t *); |
52 | 52 | ||
53 | /* Contains the handle to a sub archive */ | 53 | /* Contains the handle to a sub archive */ |
54 | struct archive_handle_t *sub_archive; | 54 | struct archive_handle_t *sub_archive; |
@@ -60,7 +60,7 @@ typedef struct archive_handle_t { | |||
60 | off_t offset; | 60 | off_t offset; |
61 | 61 | ||
62 | /* Function that skips data: read_by_char or read_by_skip */ | 62 | /* Function that skips data: read_by_char or read_by_skip */ |
63 | void (*seek)(const struct archive_handle_t *archive_handle, const unsigned amount); | 63 | void FAST_FUNC (*seek)(const struct archive_handle_t *archive_handle, const unsigned amount); |
64 | 64 | ||
65 | /* Temporary storage */ | 65 | /* Temporary storage */ |
66 | char *buffer; | 66 | char *buffer; |
@@ -71,62 +71,62 @@ typedef struct archive_handle_t { | |||
71 | } archive_handle_t; | 71 | } archive_handle_t; |
72 | 72 | ||
73 | 73 | ||
74 | extern archive_handle_t *init_handle(void); | 74 | extern archive_handle_t *init_handle(void) FAST_FUNC; |
75 | 75 | ||
76 | extern char filter_accept_all(archive_handle_t *archive_handle); | 76 | extern char filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC; |
77 | extern char filter_accept_list(archive_handle_t *archive_handle); | 77 | extern char filter_accept_list(archive_handle_t *archive_handle) FAST_FUNC; |
78 | extern char filter_accept_list_reassign(archive_handle_t *archive_handle); | 78 | extern char filter_accept_list_reassign(archive_handle_t *archive_handle) FAST_FUNC; |
79 | extern char filter_accept_reject_list(archive_handle_t *archive_handle); | 79 | extern char filter_accept_reject_list(archive_handle_t *archive_handle) FAST_FUNC; |
80 | 80 | ||
81 | extern void unpack_ar_archive(archive_handle_t *ar_archive); | 81 | extern void unpack_ar_archive(archive_handle_t *ar_archive) FAST_FUNC; |
82 | 82 | ||
83 | extern void data_skip(archive_handle_t *archive_handle); | 83 | extern void data_skip(archive_handle_t *archive_handle) FAST_FUNC; |
84 | extern void data_extract_all(archive_handle_t *archive_handle); | 84 | extern void data_extract_all(archive_handle_t *archive_handle) FAST_FUNC; |
85 | extern void data_extract_to_stdout(archive_handle_t *archive_handle); | 85 | extern void data_extract_to_stdout(archive_handle_t *archive_handle) FAST_FUNC; |
86 | extern void data_extract_to_buffer(archive_handle_t *archive_handle); | 86 | extern void data_extract_to_buffer(archive_handle_t *archive_handle) FAST_FUNC; |
87 | 87 | ||
88 | extern void header_skip(const file_header_t *file_header); | 88 | extern void header_skip(const file_header_t *file_header) FAST_FUNC; |
89 | extern void header_list(const file_header_t *file_header); | 89 | extern void header_list(const file_header_t *file_header) FAST_FUNC; |
90 | extern void header_verbose_list(const file_header_t *file_header); | 90 | extern void header_verbose_list(const file_header_t *file_header) FAST_FUNC; |
91 | 91 | ||
92 | extern char get_header_ar(archive_handle_t *archive_handle); | 92 | extern char get_header_ar(archive_handle_t *archive_handle) FAST_FUNC; |
93 | extern char get_header_cpio(archive_handle_t *archive_handle); | 93 | extern char get_header_cpio(archive_handle_t *archive_handle) FAST_FUNC; |
94 | extern char get_header_tar(archive_handle_t *archive_handle); | 94 | extern char get_header_tar(archive_handle_t *archive_handle) FAST_FUNC; |
95 | extern char get_header_tar_bz2(archive_handle_t *archive_handle); | 95 | extern char get_header_tar_bz2(archive_handle_t *archive_handle) FAST_FUNC; |
96 | extern char get_header_tar_lzma(archive_handle_t *archive_handle); | 96 | extern char get_header_tar_lzma(archive_handle_t *archive_handle) FAST_FUNC; |
97 | extern char get_header_tar_gz(archive_handle_t *archive_handle); | 97 | extern char get_header_tar_gz(archive_handle_t *archive_handle) FAST_FUNC; |
98 | 98 | ||
99 | extern void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount); | 99 | extern void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount) FAST_FUNC; |
100 | extern void seek_by_read(const archive_handle_t *archive_handle, unsigned amount); | 100 | extern void seek_by_read(const archive_handle_t *archive_handle, unsigned amount) FAST_FUNC; |
101 | 101 | ||
102 | extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned char *buf, size_t count); | 102 | extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned char *buf, size_t count) FAST_FUNC; |
103 | 103 | ||
104 | extern void data_align(archive_handle_t *archive_handle, unsigned boundary); | 104 | extern void data_align(archive_handle_t *archive_handle, unsigned boundary) FAST_FUNC; |
105 | extern const llist_t *find_list_entry(const llist_t *list, const char *filename); | 105 | extern const llist_t *find_list_entry(const llist_t *list, const char *filename) FAST_FUNC; |
106 | extern const llist_t *find_list_entry2(const llist_t *list, const char *filename); | 106 | extern const llist_t *find_list_entry2(const llist_t *list, const char *filename) FAST_FUNC; |
107 | 107 | ||
108 | /* A bit of bunzip2 internals are exposed for compressed help support: */ | 108 | /* A bit of bunzip2 internals are exposed for compressed help support: */ |
109 | typedef struct bunzip_data bunzip_data; | 109 | typedef struct bunzip_data bunzip_data; |
110 | int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf, int len); | 110 | int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf, int len) FAST_FUNC; |
111 | int read_bunzip(bunzip_data *bd, char *outbuf, int len); | 111 | int read_bunzip(bunzip_data *bd, char *outbuf, int len) FAST_FUNC; |
112 | void dealloc_bunzip(bunzip_data *bd); | 112 | void dealloc_bunzip(bunzip_data *bd) FAST_FUNC; |
113 | 113 | ||
114 | typedef struct inflate_unzip_result { | 114 | typedef struct inflate_unzip_result { |
115 | off_t bytes_out; | 115 | off_t bytes_out; |
116 | uint32_t crc; | 116 | uint32_t crc; |
117 | } inflate_unzip_result; | 117 | } inflate_unzip_result; |
118 | 118 | ||
119 | extern USE_DESKTOP(long long) int unpack_bz2_stream(int src_fd, int dst_fd); | 119 | extern USE_DESKTOP(long long) int unpack_bz2_stream(int src_fd, int dst_fd) FAST_FUNC; |
120 | extern USE_DESKTOP(long long) int inflate_unzip(inflate_unzip_result *res, off_t compr_size, int src_fd, int dst_fd); | 120 | extern USE_DESKTOP(long long) int inflate_unzip(inflate_unzip_result *res, off_t compr_size, int src_fd, int dst_fd) FAST_FUNC; |
121 | extern USE_DESKTOP(long long) int unpack_gz_stream(int src_fd, int dst_fd); | 121 | extern USE_DESKTOP(long long) int unpack_gz_stream(int src_fd, int dst_fd) FAST_FUNC; |
122 | extern USE_DESKTOP(long long) int unpack_lzma_stream(int src_fd, int dst_fd); | 122 | extern USE_DESKTOP(long long) int unpack_lzma_stream(int src_fd, int dst_fd) FAST_FUNC; |
123 | 123 | ||
124 | #if BB_MMU | 124 | #if BB_MMU |
125 | extern int open_transformer(int src_fd, | 125 | extern int open_transformer(int src_fd, |
126 | USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd)); | 126 | USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd)) FAST_FUNC; |
127 | #define open_transformer(src_fd, transformer, transform_prog) open_transformer(src_fd, transformer) | 127 | #define open_transformer(src_fd, transformer, transform_prog) open_transformer(src_fd, transformer) |
128 | #else | 128 | #else |
129 | extern int open_transformer(int src_fd, const char *transform_prog); | 129 | extern int open_transformer(int src_fd, const char *transform_prog) FAST_FUNC; |
130 | #define open_transformer(src_fd, transformer, transform_prog) open_transformer(src_fd, transform_prog) | 130 | #define open_transformer(src_fd, transformer, transform_prog) open_transformer(src_fd, transform_prog) |
131 | #endif | 131 | #endif |
132 | 132 | ||
diff --git a/include/xatonum.h b/include/xatonum.h index 6cf1299b3..944ee7742 100644 --- a/include/xatonum.h +++ b/include/xatonum.h | |||
@@ -14,20 +14,20 @@ | |||
14 | /* Provides extern declarations of functions */ | 14 | /* Provides extern declarations of functions */ |
15 | #define DECLARE_STR_CONV(type, T, UT) \ | 15 | #define DECLARE_STR_CONV(type, T, UT) \ |
16 | \ | 16 | \ |
17 | unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \ | 17 | unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx) FAST_FUNC; \ |
18 | unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u); \ | 18 | unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u) FAST_FUNC; \ |
19 | unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx); \ | 19 | unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx) FAST_FUNC; \ |
20 | unsigned type xstrto##UT(const char *str, int b); \ | 20 | unsigned type xstrto##UT(const char *str, int b) FAST_FUNC; \ |
21 | unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \ | 21 | unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx) FAST_FUNC; \ |
22 | unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u); \ | 22 | unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u) FAST_FUNC; \ |
23 | unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx); \ | 23 | unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \ |
24 | unsigned type xato##UT(const char *str); \ | 24 | unsigned type xato##UT(const char *str) FAST_FUNC; \ |
25 | type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx); \ | 25 | type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx) FAST_FUNC; \ |
26 | type xstrto##T##_range(const char *str, int b, type l, type u); \ | 26 | type xstrto##T##_range(const char *str, int b, type l, type u) FAST_FUNC; \ |
27 | type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx); \ | 27 | type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx) FAST_FUNC; \ |
28 | type xato##T##_range(const char *str, type l, type u); \ | 28 | type xato##T##_range(const char *str, type l, type u) FAST_FUNC; \ |
29 | type xato##T##_sfx(const char *str, const struct suffix_mult *sfx); \ | 29 | type xato##T##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \ |
30 | type xato##T(const char *str); \ | 30 | type xato##T(const char *str) FAST_FUNC; \ |
31 | 31 | ||
32 | /* Unsigned long long functions always exist */ | 32 | /* Unsigned long long functions always exist */ |
33 | DECLARE_STR_CONV(long long, ll, ull) | 33 | DECLARE_STR_CONV(long long, ll, ull) |
@@ -122,8 +122,8 @@ static ALWAYS_INLINE uint32_t xatou32(const char *numstr) | |||
122 | * return value is all-ones in this case. | 122 | * return value is all-ones in this case. |
123 | */ | 123 | */ |
124 | 124 | ||
125 | unsigned long long bb_strtoull(const char *arg, char **endp, int base); | 125 | unsigned long long bb_strtoull(const char *arg, char **endp, int base) FAST_FUNC; |
126 | long long bb_strtoll(const char *arg, char **endp, int base); | 126 | long long bb_strtoll(const char *arg, char **endp, int base) FAST_FUNC; |
127 | 127 | ||
128 | #if ULONG_MAX == ULLONG_MAX | 128 | #if ULONG_MAX == ULLONG_MAX |
129 | static ALWAYS_INLINE | 129 | static ALWAYS_INLINE |
@@ -133,8 +133,8 @@ static ALWAYS_INLINE | |||
133 | long bb_strtol(const char *arg, char **endp, int base) | 133 | long bb_strtol(const char *arg, char **endp, int base) |
134 | { return bb_strtoll(arg, endp, base); } | 134 | { return bb_strtoll(arg, endp, base); } |
135 | #else | 135 | #else |
136 | unsigned long bb_strtoul(const char *arg, char **endp, int base); | 136 | unsigned long bb_strtoul(const char *arg, char **endp, int base) FAST_FUNC; |
137 | long bb_strtol(const char *arg, char **endp, int base); | 137 | long bb_strtol(const char *arg, char **endp, int base) FAST_FUNC; |
138 | #endif | 138 | #endif |
139 | 139 | ||
140 | #if UINT_MAX == ULLONG_MAX | 140 | #if UINT_MAX == ULLONG_MAX |
@@ -152,8 +152,8 @@ static ALWAYS_INLINE | |||
152 | int bb_strtoi(const char *arg, char **endp, int base) | 152 | int bb_strtoi(const char *arg, char **endp, int base) |
153 | { return bb_strtol(arg, endp, base); } | 153 | { return bb_strtol(arg, endp, base); } |
154 | #else | 154 | #else |
155 | unsigned bb_strtou(const char *arg, char **endp, int base); | 155 | unsigned bb_strtou(const char *arg, char **endp, int base) FAST_FUNC; |
156 | int bb_strtoi(const char *arg, char **endp, int base); | 156 | int bb_strtoi(const char *arg, char **endp, int base) FAST_FUNC; |
157 | #endif | 157 | #endif |
158 | 158 | ||
159 | int BUG_bb_strtou32_unimplemented(void); | 159 | int BUG_bb_strtou32_unimplemented(void); |
diff --git a/include/xregex.h b/include/xregex.h index d4bf73279..90cf124ee 100644 --- a/include/xregex.h +++ b/include/xregex.h | |||
@@ -17,8 +17,8 @@ | |||
17 | # pragma GCC visibility push(hidden) | 17 | # pragma GCC visibility push(hidden) |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags); | 20 | char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags) FAST_FUNC; |
21 | void xregcomp(regex_t *preg, const char *regex, int cflags); | 21 | void xregcomp(regex_t *preg, const char *regex, int cflags) FAST_FUNC; |
22 | 22 | ||
23 | #if __GNUC_PREREQ(4,1) | 23 | #if __GNUC_PREREQ(4,1) |
24 | # pragma GCC visibility pop | 24 | # pragma GCC visibility pop |
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 | ||
104 | void bb_show_usage(void) | 104 | void 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 |
156 | int find_applet_by_name(const char *name) | 156 | int 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 | ||
707 | void run_applet_no_and_exit(int applet_no, char **argv) | 707 | void 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 | ||
725 | void run_applet_and_exit(const char *name, char **argv) | 725 | void 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 | ||
16 | int bb_ask_confirmation(void) | 16 | int 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 | ||
20 | char *bb_askpass(int timeout, const char *prompt) | 20 | char* 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 | ||
12 | const char *bb_basename(const char *name) | 12 | const 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 | ||
12 | void bb_do_delay(int seconds) | 12 | void 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 */ |
48 | char* bb_getpwuid(char *name, int bufsize, long uid) | 48 | char* 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 */ |
57 | char* bb_getgrgid(char *group, int bufsize, long gid) | 57 | char* 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 */ |
67 | long xgroup2gid(const char *name) | 67 | long 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 */ |
79 | long xuname2uid(const char *name) | 79 | long 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 | ||
90 | unsigned long get_ug_id(const char *s, | 90 | unsigned 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 | ||
12 | int bb_pstrcmp(const void *a, const void *b) | 12 | int /* 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 | ||
17 | void qsort_string_vector(char **sv, unsigned count) | 17 | void 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 | ||
51 | unsigned long long bb_strtoull(const char *arg, char **endp, int base) | 51 | unsigned 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 | ||
66 | long long bb_strtoll(const char *arg, char **endp, int base) | 66 | long 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 |
78 | unsigned long bb_strtoul(const char *arg, char **endp, int base) | 78 | unsigned 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 | ||
89 | long bb_strtol(const char *arg, char **endp, int base) | 89 | long 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 |
102 | unsigned bb_strtou(const char *arg, char **endp, int base) | 102 | unsigned 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 | ||
114 | int bb_strtoi(const char *arg, char **endp, int base) | 114 | int 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) |
134 | double bb_strtod(const char *arg, char **endp) | 134 | double 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. */ |
34 | void change_identity(const struct passwd *pw) | 34 | void 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 | ||
13 | void chomp(char *s) | 13 | void 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) */ |
10 | int index_in_str_array(const char *const string_array[], const char *key) | 10 | int 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 | ||
22 | int index_in_strings(const char *strings, const char *key) | 22 | int 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 |
39 | int index_in_substr_array(const char *const string_array[], const char *key) | 39 | int 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 | ||
54 | int index_in_substrings(const char *strings, const char *key) | 54 | int 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 | ||
71 | const char *nth_string(const char *strings, int n) | 71 | const 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 | ||
19 | char *concat_path_file(const char *path, const char *filename) | 19 | char* 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 | ||
18 | char *concat_subpath_file(const char *path, const char *f) | 18 | char* 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 | */ |
74 | int copy_file(const char *source, const char *dest, int flags) | 74 | int 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 |
88 | void complain_copyfd_and_die(off_t sz) | 88 | void 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 | ||
97 | off_t bb_copyfd_size(int fd1, int fd2, off_t size) | 97 | off_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 | ||
105 | void bb_copyfd_exact_size(int fd1, int fd2, off_t size) | 105 | void 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 | ||
116 | off_t bb_copyfd_eof(int fd1, int fd2) | 116 | off_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 | ||
39 | int correct_password(const struct passwd *pw) | 39 | int 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 | ||
19 | uint32_t *crc32_filltable(uint32_t *crc_table, int endian) | 19 | uint32_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 |
12 | int create_icmp6_socket(void) | 12 | int 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 | ||
11 | int create_icmp_socket(void) | 11 | int 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 | ||
27 | int crypt_make_salt(char *p, int cnt, int x) | 27 | int 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 */ |
13 | int device_open(const char *device, int mode) | 13 | int 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 | ||
19 | void die_if_bad_username(const char *name) | 19 | void 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 | ||
34 | static const char lcc[] ALIGN1 = "diouxX"; | 34 | static const char lcc[] ALIGN1 = "diouxX"; |
35 | 35 | ||
36 | int bb_dump_size(FS * fs) | 36 | int 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 | ||
655 | int bb_dump_dump(char **argv) | 655 | int 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 | ||
677 | void bb_dump_add(const char *fmt) | 677 | void 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 | ||
12 | void bb_error_msg(const char *s, ...) | 12 | void 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 | ||
12 | void bb_error_msg_and_die(const char *s, ...) | 12 | void 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 | */ |
16 | int execable_file(const char *name) | 16 | int 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 | */ |
31 | char *find_execable(const char *filename, char **PATHp) | 31 | char* 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 | */ |
57 | int exists_execable(const char *filename) | 57 | int 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 | */ |
73 | int bb_execvp(const char *file, char *const argv[]) | 73 | int 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 | ||
17 | int fclose_if_not_stdin(FILE *f) | 17 | int 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 | ||
16 | void fflush_stdout_and_exit(int retval) | 16 | void 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. */ |
58 | char *xmalloc_fgets_str(FILE *file, const char *terminating_string) | 58 | char* 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 | ||
63 | char *xmalloc_fgetline_str(FILE *file, const char *terminating_string) | 63 | char* 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 | */ |
20 | struct mntent *find_mount_point(const char *name, const char *table) | 20 | struct 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 | */ |
51 | pid_t* find_pid_by_name(const char* procName) | 51 | pid_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 | ||
77 | pid_t *pidlist_reverse(pid_t *pidList) | 77 | pid_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 | ||
65 | char *find_block_device(const char *path) | 65 | char* 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 | */ |
17 | ssize_t full_write(int fd, const void *buf, size_t len) | 17 | ssize_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 | ||
41 | int get_console_fd(void) | 41 | int 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 | ||
78 | void console_make_active(int fd, const int vt_num) | 78 | void 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 | */ |
17 | char *bb_get_last_path_component_nostrip(const char *path) | 17 | char* 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 | */ |
33 | char *bb_get_last_path_component_strip(char *path) | 33 | char* 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 */ |
19 | char *bb_get_chunk_from_file(FILE *file, int *end) | 19 | char* 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 */ |
52 | char *xmalloc_fgets(FILE *file) | 52 | char* 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 */ |
60 | char *xmalloc_fgetline(FILE *file) | 60 | char* 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 | ||
317 | uint32_t option_mask32; | 317 | uint32_t option_mask32; |
318 | 318 | ||
319 | uint32_t | 319 | uint32_t FAST_FUNC |
320 | getopt32(char **argv, const char *applet_opts, ...) | 320 | getopt32(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 | ||
13 | int xgetpty(char *line) | 13 | int 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 | ||
12 | void bb_herror_msg(const char *s, ...) | 12 | void 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 | ||
12 | void bb_herror_msg_and_die(const char *s, ...) | 12 | void 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 | ||
31 | const char *make_human_readable_str(unsigned long long size, | 31 | const 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 | ||
14 | int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) | 14 | int 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 | */ |
84 | char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) | 84 | char* 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 | ||
168 | int INET6_resolve(const char *name, struct sockaddr_in6 *sin6) | 168 | int 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 | ||
192 | char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) | 192 | char* 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 | ||
13 | void bb_info_msg(const char *s, ...) | 13 | void 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 | */ |
30 | char *is_in_ino_dev_hashtable(const struct stat *statbuf) | 30 | char* 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 */ |
50 | void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) | 50 | void 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 */ |
72 | void reset_ino_dev_hashtable(void) | 72 | void 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 | */ |
18 | int is_directory(const char *fileName, const int followLinks, struct stat *statBuf) | 18 | int 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 | */ |
19 | int get_linux_version_code(void) | 19 | int 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 | */ |
15 | char* last_char_is(const char *s, int c) | 15 | char* 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 | */ |
1355 | int read_line_input(const char *prompt, char *command, int maxsize, line_input_t *st) | 1355 | int 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 | ||
1848 | line_input_t *new_line_input_t(int flags) | 1848 | line_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 |
1858 | int read_line_input(const char* prompt, char* command, int maxsize) | 1858 | int 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. */ |
16 | void llist_add_to(llist_t **old_head, void *data) | 16 | void 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. */ |
26 | void llist_add_to_end(llist_t **list_head, void *data) | 26 | void 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 */ |
45 | void *llist_pop(llist_t **head) | 45 | void* 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 */ |
61 | void llist_unlink(llist_t **head, llist_t *elm) | 61 | void 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 */ |
83 | void llist_free(llist_t *elm, void (*freeit) (void *data)) | 83 | void 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. */ |
95 | llist_t *llist_rev(llist_t *list) | 95 | llist_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 @@ | |||
18 | static const char fmtstr_d[] ALIGN1 = "%A, %d %B %Y"; | 18 | static const char fmtstr_d[] ALIGN1 = "%A, %d %B %Y"; |
19 | static const char fmtstr_t[] ALIGN1 = "%H:%M:%S"; | 19 | static const char fmtstr_t[] ALIGN1 = "%H:%M:%S"; |
20 | 20 | ||
21 | void print_login_issue(const char *issue_file, const char *tty) | 21 | void 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 | ||
89 | void print_login_prompt(void) | 89 | void 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 | ||
115 | int sanitize_env_if_suid(void) | 115 | int 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 | ||
47 | char *query_loop(const char *device) | 47 | char* 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 | ||
64 | int del_loop(const char *device) | 64 | int 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 | */ |
82 | int set_loop(char **device, const char *file, unsigned long long offset) | 82 | int 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 | ||
29 | int bb_make_directory (char *path, long mode, int flags) | 29 | int 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 | ||
15 | int match_fstype(const struct mntent *mt, const char *fstype) | 15 | int 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 | */ |
27 | void md5_begin(md5_ctx_t *ctx) | 27 | void 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 | ||
374 | void md5_hash(const void *buffer, size_t len, md5_ctx_t *ctx) | 374 | void 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 | */ |
413 | void *md5_end(void *resbuf, md5_ctx_t *ctx) | 413 | void* 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 */ |
52 | static const char mode_chars[7] ALIGN1 = "rwxSTst"; | 52 | static const char mode_chars[7] ALIGN1 = "rwxSTst"; |
53 | 53 | ||
54 | const char *bb_mode_string(mode_t mode) | 54 | const 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 */ |
92 | static const char mode_chars[7] = "rwxSTst"; | 92 | static const char mode_chars[7] = "rwxSTst"; |
93 | 93 | ||
94 | const char *bb_mode_string(mode_t mode) | 94 | const 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 |
14 | void erase_mtab(const char *name) | 14 | void 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 | ||
160 | int obscure(const char *old, const char *newval, const struct passwd *pw) | 160 | int 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 | ||
18 | int bb_parse_mode(const char *s, mode_t *current_mode) | 18 | int 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 | ||
12 | void bb_perror_msg(const char *s, ...) | 12 | void 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 | ||
22 | void bb_simple_perror_msg(const char *s) | 22 | void 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 | ||
12 | void bb_perror_msg_and_die(const char *s, ...) | 12 | void 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 | ||
23 | void bb_simple_perror_msg_and_die(const char *s) | 23 | void 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" |
14 | extern void bb_perror_msg(const char *s, ...); | 14 | #include "platform.h" |
15 | extern 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 */ |
17 | void bb_perror_nomsg(void); | 18 | void FAST_FUNC bb_perror_nomsg(void); |
18 | void bb_perror_nomsg(void) | 19 | void 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" |
14 | extern void bb_perror_msg_and_die(const char *s, ...); | 14 | #include "platform.h" |
15 | extern 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 */ |
17 | void bb_perror_nomsg_and_die(void); | 18 | void FAST_FUNC bb_perror_nomsg_and_die(void); |
18 | void bb_perror_nomsg_and_die(void) | 19 | void 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 | ||
14 | smallint wrote_pidfile; | 14 | smallint wrote_pidfile; |
15 | 15 | ||
16 | void write_pidfile(const char *path) | 16 | void 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 */ |
12 | int print_flags_separated(const int *masks, const char *labels, int flags, const char *separator) | 12 | int 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 | ||
29 | int print_flags(const masks_labels_t *ml, int flags) | 29 | int 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 | ||
12 | void fputc_printable(int ch, FILE *file) | 12 | void 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 | ||
19 | char bb_process_escape_sequence(const char **ptr) | 19 | char 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 | } |
33 | void clear_username_cache(void) | 33 | void 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 | ||
55 | typedef char* ug_func(char *name, int bufsize, long uid); | 55 | typedef char* FAST_FUNC ug_func(char *name, int bufsize, long uid); |
56 | static char* get_cached(cache_t *cp, unsigned id, ug_func* fp) | 56 | static 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 | } |
69 | const char* get_cached_username(uid_t uid) | 69 | const 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 | } |
73 | const char* get_cached_groupname(gid_t gid) | 73 | const 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 | ||
81 | static int read_to_buf(const char *filename, void *buf) | 81 | static 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 | ||
96 | static procps_status_t *alloc_procps_scan(void) | 96 | static 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 | ||
110 | void free_procps_scan(procps_status_t* sp) | 110 | void 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 | ||
165 | void BUG_comm_size(void); | 165 | void BUG_comm_size(void); |
166 | procps_status_t *procps_scan(procps_status_t* sp, int flags) | 166 | procps_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 | ||
405 | void read_cmdline(char *buf, int col, unsigned pid, const char *comm) | 405 | void 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 | ||
53 | char *pw_encrypt(const char *clear, const char *salt, int cleanup) | 53 | char* 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 | ||
73 | char *pw_encrypt(const char *clear, const char *salt, int cleanup) | 73 | char* 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 | ||
12 | ssize_t safe_read(int fd, void *buf, size_t count) | 12 | ssize_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 | */ |
59 | ssize_t nonblock_safe_read(int fd, void *buf, size_t count) | 59 | ssize_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 | */ |
81 | ssize_t full_read(int fd, void *buf, size_t len) | 81 | ssize_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. |
110 | void xread(int fd, void *buf, size_t count) | 110 | void 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. |
120 | unsigned char xread_char(int fd) | 120 | unsigned 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 |
128 | char *reads(int fd, char *buffer, size_t size) | 128 | char* 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). |
155 | char *xmalloc_reads(int fd, char *buf, size_t *maxsz_p) | 155 | char* 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 | ||
188 | ssize_t read_close(int fd, void *buf, size_t size) | 188 | ssize_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 | ||
198 | ssize_t open_read_close(const char *filename, void *buf, size_t size) | 198 | ssize_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. |
208 | void *xmalloc_open_read_close(const char *filename, size_t *sizep) | 208 | void* 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. |
250 | void *xmalloc_open_read_close(const char *filename, size_t *sizep) | 250 | void* 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 | ||
287 | void *xmalloc_xopen_read_close(const char *filename, size_t *sizep) | 287 | void* 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 | ||
25 | static int true_action(const char *fileName ATTRIBUTE_UNUSED, | 25 | static 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 | ||
56 | int recursive_action(const char *fileName, | 56 | int 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 | ||
14 | int remove_file(const char *path, int flags) | 14 | int 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. */ |
35 | int restricted_shell(const char *shell) | 35 | int 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 | ||
14 | int rtc_adjtime_is_utc(void) | 14 | int 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 | ||
43 | int rtc_xopen(const char **default_rtc, int flags) | 43 | int 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 | ||
62 | time_t rtc_read_time(int fd, int utc) | 62 | time_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 |
37 | static security_context_t current_sid; | 37 | static security_context_t current_sid; |
38 | 38 | ||
39 | void | 39 | void FAST_FUNC renew_current_security_context(void) |
40 | renew_current_security_context(void) | ||
41 | { | 40 | { |
42 | freecon(current_sid); /* Release old context */ | 41 | freecon(current_sid); /* Release old context */ |
43 | getcon(¤t_sid); /* update */ | 42 | getcon(¤t_sid); /* update */ |
44 | } | 43 | } |
45 | void | 44 | void FAST_FUNC set_current_security_context(security_context_t sid) |
46 | set_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 | ||
59 | void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) | 57 | void 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 | */ |
36 | char *safe_gethostname(void) | 36 | char* 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! */ |
15 | int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout) | 15 | int 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. */ |
13 | char *safe_strncpy(char *dst, const char *src, size_t size) | 13 | char* 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 | ||
12 | ssize_t safe_write(int fd, const void *buf, size_t count) | 12 | ssize_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 | ||
10 | context_t set_security_context_component(security_context_t cur_context, | 10 | context_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 | ||
32 | void setfscreatecon_or_die(security_context_t scontext) | 32 | void 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 | ||
42 | void selinux_preserve_fcontext(int fdesc) | 42 | void 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 | ||
33 | void setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw) | 33 | void 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 | ||
86 | void sha1_begin(sha1_ctx_t *ctx) | 86 | void 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. */ |
98 | void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) | 98 | void 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 | ||
119 | void *sha1_end(void *resbuf, sha1_ctx_t *ctx) | 119 | void* 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... */ |
15 | int sigaction_set(int signum, const struct sigaction *act) | 15 | int 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 | ||
20 | int sigprocmask_allsigs(int how) | 20 | int 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 | ||
27 | void bb_signals(int sigs, void (*f)(int)) | 27 | void 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 | ||
42 | void bb_signals_recursive(int sigs, void (*f)(int)) | 42 | void 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 | ||
63 | void sig_block(int sig) | 63 | void 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 | ||
71 | void sig_unblock(int sig) | 71 | void 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 | ||
79 | void wait_for_any_sig(void) | 79 | void 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 */ |
87 | void kill_myself_with_sig(int sig) | 87 | void 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 | ||
95 | void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) | 95 | void 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 | ||
105 | void signal_no_SA_RESTART_empty_mask(int sig, void (*handler)(int)) | 105 | void 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 | ||
12 | char *bb_simplify_path(const char *path) | 12 | char* 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 | ||
12 | char *skip_whitespace(const char *s) | 12 | char* 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 | ||
20 | char *skip_non_whitespace(const char *s) | 20 | char* 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 | ||
57 | enum { NUM_SPEEDS = ARRAY_SIZE(speeds) }; | 57 | enum { NUM_SPEEDS = ARRAY_SIZE(speeds) }; |
58 | 58 | ||
59 | unsigned int tty_baud_to_value(speed_t speed) | 59 | unsigned 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 | ||
75 | speed_t tty_value_to_baud(unsigned int value) | 75 | speed_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" |
7 | char* str_tolower(char *str) | 7 | |
8 | char* 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 | */ |
22 | char* strrstr(const char *haystack, const char *needle) | 22 | char* 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 */ |
23 | unsigned long long monotonic_us(void) | 23 | unsigned 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 | } |
30 | unsigned monotonic_sec(void) | 30 | unsigned 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 |
38 | unsigned long long monotonic_us(void) | 38 | unsigned 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 | ||
45 | unsigned monotonic_sec(void) | 45 | unsigned 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 | ||
13 | void trim(char *s) | 13 | void 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 | ||
124 | int get_signum(const char *name) | 124 | int 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 | ||
158 | const char *get_signame(int number) | 158 | const 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 | ||
171 | void print_signames(void) | 171 | void 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 | */ |
16 | void | 16 | void FAST_FUNC |
17 | socket_want_pktinfo(int fd) | 17 | socket_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 | ||
28 | ssize_t | 28 | ssize_t FAST_FUNC |
29 | send_to_from(int fd, void *buf, size_t len, int flags, | 29 | send_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(). */ |
103 | ssize_t | 103 | ssize_t FAST_FUNC |
104 | recv_from_to(int fd, void *buf, size_t len, int flags, | 104 | recv_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 | ||
39 | int update_passwd(const char *filename, const char *username, | 39 | int 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 | */ |
42 | void bb_uuencode(char *p, const void *src, int length, const char *tbl) | 42 | void 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 |
13 | int vdprintf(int d, const char *format, va_list ap) | 13 | int 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 @@ | |||
13 | smallint logmode = LOGMODE_STDIO; | 13 | smallint logmode = LOGMODE_STDIO; |
14 | const char *msg_eol = "\n"; | 14 | const char *msg_eol = "\n"; |
15 | 15 | ||
16 | void bb_verror_msg(const char *s, va_list p, const char* strerr) | 16 | void 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 | ||
73 | void bb_verror_msg(const char *s, va_list p, const char* strerr) | 73 | void 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. */ |
23 | pid_t spawn(char **argv) | 23 | pid_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. */ |
61 | pid_t xspawn(char **argv) | 61 | pid_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 | ||
69 | int safe_waitpid(int pid, int *wstat, int options) | 69 | int 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 | ||
79 | int wait_any_nohang(int *wstat) | 79 | int 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. |
85 | int wait4pid(int pid) | 85 | int 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 |
104 | void save_nofork_data(struct nofork_save_area *save) | 104 | void 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 | ||
114 | void restore_nofork_data(struct nofork_save_area *save) | 114 | void 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 | ||
123 | int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **argv) | 123 | int 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 | ||
169 | int run_nofork_applet(int applet_no, char **argv) | 169 | int 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 | ||
179 | int spawn_and_wait(char **argv) | 179 | int 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 |
213 | void re_exec(char **argv) | 213 | void 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 | ||
222 | void forkexit_or_rexec(char **argv) | 222 | void 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 |
240 | void forkexit_or_rexec(void) | 240 | void 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" */ |
255 | void bb_daemonize_or_rexec(int flags, char **argv) | 255 | void 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 | ||
289 | void bb_sanitize_stdio(void) | 289 | void 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 | ||
12 | void bb_warn_ignoring_args(int n) | 12 | void 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 | ||
12 | FILE *fopen_or_warn(const char *path, const char *mode) | 12 | FILE* 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 | ||
17 | FILE *fopen_or_warn_stdin(const char *filename) | 17 | FILE* 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 | ||
29 | FILE *xfopen_stdin(const char *filename) | 29 | FILE* 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 | ||
37 | int open_or_warn_stdin(const char *filename) | 37 | int 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. */ |
14 | void xopen_xwrite_close(const char* file, const char* str) | 14 | void 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 | ||
62 | int xatoi_u(const char *numstr) | 62 | int 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 | ||
67 | uint16_t xatou16(const char *numstr) | 67 | uint16_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 | ||
15 | unsigned type xstrtou(_range_sfx)(const char *numstr, int base, | 15 | unsigned 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 | ||
74 | unsigned type xstrtou(_range)(const char *numstr, int base, | 74 | unsigned 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 | ||
81 | unsigned type xstrtou(_sfx)(const char *numstr, int base, | 81 | unsigned 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 | ||
87 | unsigned type xstrtou()(const char *numstr, int base) | 87 | unsigned 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 | ||
92 | unsigned type xatou(_range_sfx)(const char *numstr, | 92 | unsigned 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 | ||
100 | unsigned type xatou(_range)(const char *numstr, | 100 | unsigned 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 | ||
107 | unsigned type xatou(_sfx)(const char *numstr, | 107 | unsigned 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 | ||
113 | unsigned type xatou()(const char *numstr) | 113 | unsigned 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 | ||
120 | type xstrto(_range_sfx)(const char *numstr, int base, | 120 | type 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 | ||
151 | type xstrto(_range)(const char *numstr, int base, type lower, type upper) | 151 | type 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 | ||
156 | type xato(_range_sfx)(const char *numstr, | 156 | type 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 | ||
164 | type xato(_range)(const char *numstr, type lower, type upper) | 164 | type 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 | ||
169 | type xato(_sfx)(const char *numstr, const struct suffix_mult *suffixes) | 169 | type 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 | ||
174 | type xato()(const char *numstr) | 174 | type 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 | ||
12 | void setsockopt_reuseaddr(int fd) | 12 | void 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 | } |
16 | int setsockopt_broadcast(int fd) | 16 | int 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 | ||
21 | void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) | 21 | void 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 */ |
38 | unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) | 38 | unsigned 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 | /* |
63 | void bb_lookup_host(struct sockaddr_in *s_in, const char *host) | 63 | void 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 | ||
74 | int xconnect_tcp_v4(struct sockaddr_in *s_addr) | 74 | int 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 | ||
85 | int get_nport(const struct sockaddr *sa) | 85 | int 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 | ||
99 | void set_nport(len_and_sockaddr *lsa, unsigned port) | 99 | void 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 |
208 | len_and_sockaddr* host_and_af2sockaddr(const char *host, int port, sa_family_t af) | 208 | len_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 | ||
213 | len_and_sockaddr* xhost_and_af2sockaddr(const char *host, int port, sa_family_t af) | 213 | len_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 | ||
219 | len_and_sockaddr* host2sockaddr(const char *host, int port) | 219 | len_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 | ||
224 | len_and_sockaddr* xhost2sockaddr(const char *host, int port) | 224 | len_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 | ||
229 | len_and_sockaddr* xdotted2sockaddr(const char *host, int port) | 229 | len_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 |
235 | int xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int family,) int sock_type) | 235 | int 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 | ||
267 | int xsocket_stream(len_and_sockaddr **lsap) | 267 | int 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 | ||
291 | int create_and_bind_stream_or_die(const char *bindaddr, int port) | 291 | int 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 | ||
296 | int create_and_bind_dgram_or_die(const char *bindaddr, int port) | 296 | int 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 | ||
302 | int create_and_connect_stream_or_die(const char *peer, int port) | 302 | int 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 | ||
315 | int xconnect_stream(const len_and_sockaddr *lsa) | 315 | int 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 |
325 | static char* sockaddr2str(const struct sockaddr *sa, int flags) | 325 | static 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 | ||
364 | char* xmalloc_sockaddr2host(const struct sockaddr *sa) | 364 | char* FAST_FUNC xmalloc_sockaddr2host(const struct sockaddr *sa) |
365 | { | 365 | { |
366 | return sockaddr2str(sa, 0); | 366 | return sockaddr2str(sa, 0); |
367 | } | 367 | } |
368 | 368 | ||
369 | char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa) | 369 | char* 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 | ||
374 | char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa) | 374 | char* 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 | } |
378 | char* xmalloc_sockaddr2dotted(const struct sockaddr *sa) | 378 | char* 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 | ||
383 | char* xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa) | 383 | char* 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; | |||
17 | jmp_buf die_jmp; | 17 | jmp_buf die_jmp; |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | void xfunc_die(void) | 20 | void 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 */ |
28 | int ndelay_on(int fd) | 28 | int 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 | ||
33 | int ndelay_off(int fd) | 33 | int 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 | ||
38 | int close_on_exec_on(int fd) | 38 | int 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) */ |
46 | void smart_ulltoa4(unsigned long long ul, char buf[5], const char *scale) | 46 | void 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) */ |
94 | void smart_ulltoa5(unsigned long long ul, char buf[6], const char *scale) | 94 | void 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. |
151 | void BUG_sizeof_unsigned_not_4(void); | 151 | void BUG_sizeof_unsigned_not_4(void); |
152 | char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) | 152 | char* 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() */ |
173 | char *itoa_to_buf(int n, char *buf, unsigned buflen) | 173 | char* 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) | |||
190 | static char local_buf[sizeof(int) * 3]; | 190 | static 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). |
193 | char *utoa(unsigned n) | 193 | char* 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). */ |
201 | char *itoa(int n) | 201 | char* 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 */ |
209 | char *bin2hex(char *p, const char *cp, int count) | 209 | char* 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 |
223 | off_t fdlength(int fd) | 223 | off_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. */ |
265 | int get_terminal_width_height(int fd, unsigned *width, unsigned *height) | 265 | int 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. |
36 | void *malloc_or_warn(size_t size) | 36 | void* 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. |
45 | void *xmalloc(size_t size) | 45 | void* 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.) |
56 | void *xrealloc(void *ptr, size_t size) | 56 | void* 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. |
66 | void *xzalloc(size_t size) | 66 | void* 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. |
74 | char * xstrdup(const char *s) | 74 | char* 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. |
91 | char *xstrndup(const char *s, int n) | 91 | char* 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. |
117 | FILE *xfopen(const char *path, const char *mode) | 117 | FILE* 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. |
126 | int xopen3(const char *pathname, int flags, int mode) | 126 | int 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. |
138 | int xopen(const char *pathname, int flags) | 138 | int 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. |
144 | int open3_or_warn(const char *pathname, int flags, int mode) | 144 | int 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. |
156 | int open_or_warn(const char *pathname, int flags) | 156 | int 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 | ||
161 | void xunlink(const char *pathname) | 161 | void 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 | ||
167 | void xrename(const char *oldpath, const char *newpath) | 167 | void 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 | ||
173 | int rename_or_warn(const char *oldpath, const char *newpath) | 173 | int 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 | ||
181 | void xpipe(int filedes[2]) | 181 | void 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 | ||
187 | void xdup2(int from, int to) | 187 | void 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 |
194 | void xmove_fd(int from, int to) | 194 | void 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. |
203 | void xwrite(int fd, const void *buf, size_t count) | 203 | void 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. |
213 | off_t xlseek(int fd, off_t offset, int whence) | 213 | off_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. |
225 | void die_if_ferror(FILE *fp, const char *fn) | 225 | void 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. |
234 | void die_if_ferror_stdout(void) | 234 | void 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. |
240 | void xfflush_stdout(void) | 240 | void 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 | ||
248 | int bb_putchar(int ch) | 248 | int 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. */ |
258 | void xprint_and_close_file(FILE *file) | 258 | void 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. |
270 | char *xasprintf(const char *format, ...) | 270 | char* 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... */ |
298 | int fdprintf(int fd, const char *format, ...) | 298 | int 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 | ||
330 | void xsetenv(const char *key, const char *value) | 330 | void 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.) |
339 | void xsetgid(gid_t gid) | 339 | void 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.) |
345 | void xsetuid(uid_t uid) | 345 | void 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. |
351 | void xchdir(const char *path) | 351 | void 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 | ||
357 | void xchroot(const char *path) | 357 | void 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. |
364 | DIR *warn_opendir(const char *path) | 364 | DIR* 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. |
375 | DIR *xopendir(const char *path) | 375 | DIR* 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. |
386 | int xsocket(int domain, int type, int protocol) | 386 | int 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. |
407 | void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen) | 407 | void 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. |
413 | void xlisten(int s, int backlog) | 413 | void 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 */ |
420 | ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, | 420 | ssize_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 |
433 | void xstat(const char *name, struct stat *stat_buf) | 433 | void 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. |
440 | void selinux_or_die(void) | 440 | void 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 | ||
454 | int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) | 454 | int 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 | ||
470 | int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) | 470 | int 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 |
484 | int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name) | 484 | int 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 | } |
493 | int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name) | 493 | int 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 |
503 | int bb_ioctl_or_warn(int fd, unsigned request, void *argp) | 503 | int 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 | } |
512 | int bb_xioctl(int fd, unsigned request, void *argp) | 512 | int 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 | ||
17 | char * | 17 | char* FAST_FUNC |
18 | xrealloc_getcwd_or_warn(char *cwd) | 18 | xrealloc_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 | ||
13 | struct hostent *xgethostbyname(const char *name) | 13 | struct 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 | */ |
13 | char *xmalloc_readlink(const char *path) | 13 | char* 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 | */ |
45 | char *xmalloc_follow_symlinks(const char *path) | 45 | char* 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 | ||
87 | char *xmalloc_readlink_or_warn(const char *path) | 87 | char* 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 |
99 | char *xmalloc_realpath(const char *path) | 99 | char* 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 | ||
14 | char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags) | 14 | char* 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 | ||
26 | void xregcomp(regex_t *preg, const char *regex, int cflags) | 26 | void 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) { |
diff --git a/libpwdgrp/uidgid_get.c b/libpwdgrp/uidgid_get.c index b0085c423..88f4e2545 100644 --- a/libpwdgrp/uidgid_get.c +++ b/libpwdgrp/uidgid_get.c | |||
@@ -28,7 +28,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
28 | #include "libbb.h" | 28 | #include "libbb.h" |
29 | 29 | ||
30 | /* Always sets uid and gid */ | 30 | /* Always sets uid and gid */ |
31 | int get_uidgid(struct bb_uidgid_t *u, const char *ug, int numeric_ok) | 31 | int FAST_FUNC get_uidgid(struct bb_uidgid_t *u, const char *ug, int numeric_ok) |
32 | { | 32 | { |
33 | struct passwd *pwd; | 33 | struct passwd *pwd; |
34 | struct group *gr; | 34 | struct group *gr; |
@@ -84,7 +84,7 @@ int get_uidgid(struct bb_uidgid_t *u, const char *ug, int numeric_ok) | |||
84 | * "user:group" sets uid and gid | 84 | * "user:group" sets uid and gid |
85 | * ('unset' uid or gid is actually set to -1) | 85 | * ('unset' uid or gid is actually set to -1) |
86 | */ | 86 | */ |
87 | void parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_group) | 87 | void FAST_FUNC parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_group) |
88 | { | 88 | { |
89 | char *group; | 89 | char *group; |
90 | 90 | ||
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index c9495b2c1..863ccdf72 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c | |||
@@ -72,7 +72,7 @@ static void new_group(char *group, gid_t gid) | |||
72 | #if ENABLE_FEATURE_ADDUSER_TO_GROUP | 72 | #if ENABLE_FEATURE_ADDUSER_TO_GROUP |
73 | static void add_user_to_group(char **args, | 73 | static void add_user_to_group(char **args, |
74 | const char *path, | 74 | const char *path, |
75 | FILE *(*fopen_func)(const char *fileName, const char *mode)) | 75 | FILE* FAST_FUNC (*fopen_func)(const char *fileName, const char *mode)) |
76 | { | 76 | { |
77 | char *line; | 77 | char *line; |
78 | int len = strlen(args[1]); | 78 | int len = strlen(args[1]); |
diff --git a/loginutils/deluser.c b/loginutils/deluser.c index c67ad7200..56253712e 100644 --- a/loginutils/deluser.c +++ b/loginutils/deluser.c | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | static void del_line_matching(char **args, | 20 | static void del_line_matching(char **args, |
21 | const char *filename, | 21 | const char *filename, |
22 | FILE *(*fopen_func)(const char *fileName, const char *mode)) | 22 | FILE* FAST_FUNC (*fopen_func)(const char *fileName, const char *mode)) |
23 | { | 23 | { |
24 | FILE *passwd; | 24 | FILE *passwd; |
25 | smallint error = NAME_NOT_FOUND; | 25 | smallint error = NAME_NOT_FOUND; |
diff --git a/modutils/depmod.c b/modutils/depmod.c index fdeb7dcf1..4fba53751 100644 --- a/modutils/depmod.c +++ b/modutils/depmod.c | |||
@@ -47,7 +47,7 @@ static char* find_keyword(void *the_module, size_t len, const char * const word) | |||
47 | } while (1); | 47 | } while (1); |
48 | return ptr; | 48 | return ptr; |
49 | } | 49 | } |
50 | static int fileAction(const char *fname, struct stat *sb, | 50 | static int FAST_FUNC fileAction(const char *fname, struct stat *sb, |
51 | void ATTRIBUTE_UNUSED *data, int ATTRIBUTE_UNUSED depth) | 51 | void ATTRIBUTE_UNUSED *data, int ATTRIBUTE_UNUSED depth) |
52 | { | 52 | { |
53 | size_t len = sb->st_size; | 53 | size_t len = sb->st_size; |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 4ac1a1e1b..8217629b2 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -791,7 +791,7 @@ static char *m_fullName; | |||
791 | /*======================================================================*/ | 791 | /*======================================================================*/ |
792 | 792 | ||
793 | 793 | ||
794 | static int check_module_name_match(const char *filename, | 794 | static int FAST_FUNC check_module_name_match(const char *filename, |
795 | struct stat *statbuf ATTRIBUTE_UNUSED, | 795 | struct stat *statbuf ATTRIBUTE_UNUSED, |
796 | void *userdata, int depth ATTRIBUTE_UNUSED) | 796 | void *userdata, int depth ATTRIBUTE_UNUSED) |
797 | { | 797 | { |
@@ -3306,7 +3306,7 @@ static int obj_create_image(struct obj_file *f, char *image) | |||
3306 | 3306 | ||
3307 | /*======================================================================*/ | 3307 | /*======================================================================*/ |
3308 | 3308 | ||
3309 | static struct obj_file *obj_load(FILE * fp, int loadprogbits ATTRIBUTE_UNUSED) | 3309 | static struct obj_file *obj_load(FILE *fp, int loadprogbits ATTRIBUTE_UNUSED) |
3310 | { | 3310 | { |
3311 | struct obj_file *f; | 3311 | struct obj_file *f; |
3312 | ElfW(Shdr) * section_headers; | 3312 | ElfW(Shdr) * section_headers; |
@@ -3512,7 +3512,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits ATTRIBUTE_UNUSED) | |||
3512 | * kernel for the module | 3512 | * kernel for the module |
3513 | */ | 3513 | */ |
3514 | 3514 | ||
3515 | static int obj_load_progbits(FILE * fp, struct obj_file* f, char* imagebase) | 3515 | static int obj_load_progbits(FILE *fp, struct obj_file *f, char *imagebase) |
3516 | { | 3516 | { |
3517 | ElfW(Addr) base = f->baseaddr; | 3517 | ElfW(Addr) base = f->baseaddr; |
3518 | struct obj_section* sec; | 3518 | struct obj_section* sec; |
diff --git a/networking/dnsd.c b/networking/dnsd.c index 97ba2dc6a..bd0fad4c2 100644 --- a/networking/dnsd.c +++ b/networking/dnsd.c | |||
@@ -109,7 +109,7 @@ static void undot(uint8_t * rip) | |||
109 | * Presently the dot is copied into name without | 109 | * Presently the dot is copied into name without |
110 | * converting to a length/string substring for that label. | 110 | * converting to a length/string substring for that label. |
111 | */ | 111 | */ |
112 | static int getfileentry(FILE * fp, struct dns_entry *s) | 112 | static int getfileentry(FILE *fp, struct dns_entry *s) |
113 | { | 113 | { |
114 | unsigned int a,b,c,d; | 114 | unsigned int a,b,c,d; |
115 | char *line, *r, *name; | 115 | char *line, *r, *name; |
diff --git a/networking/interface.c b/networking/interface.c index efae03bf3..afc7d0b80 100644 --- a/networking/interface.c +++ b/networking/interface.c | |||
@@ -89,7 +89,7 @@ struct in6_ifreq { | |||
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | /* Display an Internet socket address. */ | 91 | /* Display an Internet socket address. */ |
92 | static const char *INET_sprint(struct sockaddr *sap, int numeric) | 92 | static const char* FAST_FUNC INET_sprint(struct sockaddr *sap, int numeric) |
93 | { | 93 | { |
94 | static char *buff; | 94 | static char *buff; |
95 | 95 | ||
@@ -143,7 +143,7 @@ static int INET_getsock(char *bufp, struct sockaddr *sap) | |||
143 | } | 143 | } |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | static int INET_input(/*int type,*/ const char *bufp, struct sockaddr *sap) | 146 | static int FAST_FUNC INET_input(/*int type,*/ const char *bufp, struct sockaddr *sap) |
147 | { | 147 | { |
148 | return INET_resolve(bufp, (struct sockaddr_in *) sap, 0); | 148 | return INET_resolve(bufp, (struct sockaddr_in *) sap, 0); |
149 | /* | 149 | /* |
@@ -159,19 +159,19 @@ static int INET_input(/*int type,*/ const char *bufp, struct sockaddr *sap) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | static const struct aftype inet_aftype = { | 161 | static const struct aftype inet_aftype = { |
162 | .name = "inet", | 162 | .name = "inet", |
163 | .title = "DARPA Internet", | 163 | .title = "DARPA Internet", |
164 | .af = AF_INET, | 164 | .af = AF_INET, |
165 | .alen = 4, | 165 | .alen = 4, |
166 | .sprint = INET_sprint, | 166 | .sprint = INET_sprint, |
167 | .input = INET_input, | 167 | .input = INET_input, |
168 | }; | 168 | }; |
169 | 169 | ||
170 | #ifdef HAVE_AFINET6 | 170 | #ifdef HAVE_AFINET6 |
171 | 171 | ||
172 | /* Display an Internet socket address. */ | 172 | /* Display an Internet socket address. */ |
173 | /* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */ | 173 | /* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */ |
174 | static const char *INET6_sprint(struct sockaddr *sap, int numeric) | 174 | static const char* FAST_FUNC INET6_sprint(struct sockaddr *sap, int numeric) |
175 | { | 175 | { |
176 | static char *buff; | 176 | static char *buff; |
177 | 177 | ||
@@ -198,7 +198,7 @@ static int INET6_getsock(char *bufp, struct sockaddr *sap) | |||
198 | } | 198 | } |
199 | #endif | 199 | #endif |
200 | 200 | ||
201 | static int INET6_input(/*int type,*/ const char *bufp, struct sockaddr *sap) | 201 | static int FAST_FUNC INET6_input(/*int type,*/ const char *bufp, struct sockaddr *sap) |
202 | { | 202 | { |
203 | return INET6_resolve(bufp, (struct sockaddr_in6 *) sap); | 203 | return INET6_resolve(bufp, (struct sockaddr_in6 *) sap); |
204 | /* | 204 | /* |
@@ -212,18 +212,18 @@ static int INET6_input(/*int type,*/ const char *bufp, struct sockaddr *sap) | |||
212 | } | 212 | } |
213 | 213 | ||
214 | static const struct aftype inet6_aftype = { | 214 | static const struct aftype inet6_aftype = { |
215 | .name = "inet6", | 215 | .name = "inet6", |
216 | .title = "IPv6", | 216 | .title = "IPv6", |
217 | .af = AF_INET6, | 217 | .af = AF_INET6, |
218 | .alen = sizeof(struct in6_addr), | 218 | .alen = sizeof(struct in6_addr), |
219 | .sprint = INET6_sprint, | 219 | .sprint = INET6_sprint, |
220 | .input = INET6_input, | 220 | .input = INET6_input, |
221 | }; | 221 | }; |
222 | 222 | ||
223 | #endif /* HAVE_AFINET6 */ | 223 | #endif /* HAVE_AFINET6 */ |
224 | 224 | ||
225 | /* Display an UNSPEC address. */ | 225 | /* Display an UNSPEC address. */ |
226 | static char *UNSPEC_print(unsigned char *ptr) | 226 | static char* FAST_FUNC UNSPEC_print(unsigned char *ptr) |
227 | { | 227 | { |
228 | static char *buff; | 228 | static char *buff; |
229 | 229 | ||
@@ -244,7 +244,7 @@ static char *UNSPEC_print(unsigned char *ptr) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | /* Display an UNSPEC socket address. */ | 246 | /* Display an UNSPEC socket address. */ |
247 | static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric ATTRIBUTE_UNUSED) | 247 | static const char* FAST_FUNC UNSPEC_sprint(struct sockaddr *sap, int numeric ATTRIBUTE_UNUSED) |
248 | { | 248 | { |
249 | if (sap->sa_family == 0xFFFF || sap->sa_family == 0) | 249 | if (sap->sa_family == 0xFFFF || sap->sa_family == 0) |
250 | return "[NONE SET]"; | 250 | return "[NONE SET]"; |
@@ -270,7 +270,7 @@ static const struct aftype *const aftypes[] = { | |||
270 | }; | 270 | }; |
271 | 271 | ||
272 | /* Check our protocol family table for this family. */ | 272 | /* Check our protocol family table for this family. */ |
273 | const struct aftype *get_aftype(const char *name) | 273 | const struct aftype* FAST_FUNC get_aftype(const char *name) |
274 | { | 274 | { |
275 | const struct aftype *const *afp; | 275 | const struct aftype *const *afp; |
276 | 276 | ||
@@ -720,7 +720,7 @@ static const struct hwtype loop_hwtype = { | |||
720 | #endif | 720 | #endif |
721 | 721 | ||
722 | /* Display an Ethernet address in readable format. */ | 722 | /* Display an Ethernet address in readable format. */ |
723 | static char *pr_ether(unsigned char *ptr) | 723 | static char* FAST_FUNC ether_print(unsigned char *ptr) |
724 | { | 724 | { |
725 | static char *buff; | 725 | static char *buff; |
726 | 726 | ||
@@ -732,15 +732,15 @@ static char *pr_ether(unsigned char *ptr) | |||
732 | return buff; | 732 | return buff; |
733 | } | 733 | } |
734 | 734 | ||
735 | static int in_ether(const char *bufp, struct sockaddr *sap); | 735 | static int FAST_FUNC ether_input(const char *bufp, struct sockaddr *sap); |
736 | 736 | ||
737 | static const struct hwtype ether_hwtype = { | 737 | static const struct hwtype ether_hwtype = { |
738 | .name = "ether", | 738 | .name = "ether", |
739 | .title = "Ethernet", | 739 | .title = "Ethernet", |
740 | .type = ARPHRD_ETHER, | 740 | .type = ARPHRD_ETHER, |
741 | .alen = ETH_ALEN, | 741 | .alen = ETH_ALEN, |
742 | .print = pr_ether, | 742 | .print = ether_print, |
743 | .input = in_ether | 743 | .input = ether_input |
744 | }; | 744 | }; |
745 | 745 | ||
746 | static unsigned hexchar2int(char c) | 746 | static unsigned hexchar2int(char c) |
@@ -754,7 +754,7 @@ static unsigned hexchar2int(char c) | |||
754 | } | 754 | } |
755 | 755 | ||
756 | /* Input an Ethernet address and convert to binary. */ | 756 | /* Input an Ethernet address and convert to binary. */ |
757 | static int in_ether(const char *bufp, struct sockaddr *sap) | 757 | static int FAST_FUNC ether_input(const char *bufp, struct sockaddr *sap) |
758 | { | 758 | { |
759 | unsigned char *ptr; | 759 | unsigned char *ptr; |
760 | char c; | 760 | char c; |
@@ -813,12 +813,12 @@ static const struct hwtype sit_hwtype = { | |||
813 | #endif | 813 | #endif |
814 | #if ENABLE_FEATURE_HWIB | 814 | #if ENABLE_FEATURE_HWIB |
815 | static const struct hwtype ib_hwtype = { | 815 | static const struct hwtype ib_hwtype = { |
816 | .name = "infiniband", | 816 | .name = "infiniband", |
817 | .title = "InfiniBand", | 817 | .title = "InfiniBand", |
818 | .type = ARPHRD_INFINIBAND, | 818 | .type = ARPHRD_INFINIBAND, |
819 | .alen = INFINIBAND_ALEN, | 819 | .alen = INFINIBAND_ALEN, |
820 | .print = UNSPEC_print, | 820 | .print = UNSPEC_print, |
821 | .input = in_ib, | 821 | .input = in_ib, |
822 | }; | 822 | }; |
823 | #endif | 823 | #endif |
824 | 824 | ||
@@ -852,7 +852,7 @@ static const char *const if_port_text[] = { | |||
852 | #endif | 852 | #endif |
853 | 853 | ||
854 | /* Check our hardware type table for this type. */ | 854 | /* Check our hardware type table for this type. */ |
855 | const struct hwtype *get_hwtype(const char *name) | 855 | const struct hwtype* FAST_FUNC get_hwtype(const char *name) |
856 | { | 856 | { |
857 | const struct hwtype *const *hwp; | 857 | const struct hwtype *const *hwp; |
858 | 858 | ||
@@ -866,7 +866,7 @@ const struct hwtype *get_hwtype(const char *name) | |||
866 | } | 866 | } |
867 | 867 | ||
868 | /* Check our hardware type table for this type. */ | 868 | /* Check our hardware type table for this type. */ |
869 | const struct hwtype *get_hwntype(int type) | 869 | const struct hwtype* FAST_FUNC get_hwntype(int type) |
870 | { | 870 | { |
871 | const struct hwtype *const *hwp; | 871 | const struct hwtype *const *hwp; |
872 | 872 | ||
@@ -1214,7 +1214,7 @@ static int if_print(char *ifname) | |||
1214 | 1214 | ||
1215 | #if ENABLE_FEATURE_HWIB | 1215 | #if ENABLE_FEATURE_HWIB |
1216 | /* Input an Infiniband address and convert to binary. */ | 1216 | /* Input an Infiniband address and convert to binary. */ |
1217 | int in_ib(const char *bufp, struct sockaddr *sap) | 1217 | int FAST_FUNC in_ib(const char *bufp, struct sockaddr *sap) |
1218 | { | 1218 | { |
1219 | unsigned char *ptr; | 1219 | unsigned char *ptr; |
1220 | char c; | 1220 | char c; |
@@ -1272,7 +1272,7 @@ int in_ib(const char *bufp, struct sockaddr *sap) | |||
1272 | #endif | 1272 | #endif |
1273 | 1273 | ||
1274 | 1274 | ||
1275 | int display_interfaces(char *ifname) | 1275 | int FAST_FUNC display_interfaces(char *ifname) |
1276 | { | 1276 | { |
1277 | int status; | 1277 | int status; |
1278 | 1278 | ||
diff --git a/networking/route.c b/networking/route.c index 857424c3b..0146fa029 100644 --- a/networking/route.c +++ b/networking/route.c | |||
@@ -476,7 +476,7 @@ static void set_flags(char *flagstr, int flags) | |||
476 | } | 476 | } |
477 | 477 | ||
478 | /* also used in netstat */ | 478 | /* also used in netstat */ |
479 | void bb_displayroutes(int noresolve, int netstatfmt) | 479 | void FAST_FUNC bb_displayroutes(int noresolve, int netstatfmt) |
480 | { | 480 | { |
481 | char devname[64], flags[16], *sdest, *sgw; | 481 | char devname[64], flags[16], *sdest, *sgw; |
482 | unsigned long d, g, m; | 482 | unsigned long d, g, m; |
diff --git a/selinux/chcon.c b/selinux/chcon.c index 288e93ad3..505ae4f32 100644 --- a/selinux/chcon.c +++ b/selinux/chcon.c | |||
@@ -28,7 +28,7 @@ static char *type = NULL; | |||
28 | static char *range = NULL; | 28 | static char *range = NULL; |
29 | static char *specified_context = NULL; | 29 | static char *specified_context = NULL; |
30 | 30 | ||
31 | static int change_filedir_context( | 31 | static int FAST_FUNC change_filedir_context( |
32 | const char *fname, | 32 | const char *fname, |
33 | struct stat *stbuf ATTRIBUTE_UNUSED, | 33 | struct stat *stbuf ATTRIBUTE_UNUSED, |
34 | void *userData ATTRIBUTE_UNUSED, | 34 | void *userData ATTRIBUTE_UNUSED, |
diff --git a/selinux/setfiles.c b/selinux/setfiles.c index 82e9e5348..991c13cd7 100644 --- a/selinux/setfiles.c +++ b/selinux/setfiles.c | |||
@@ -391,7 +391,7 @@ static int restore(const char *file) | |||
391 | * This function is called by recursive_action on each file during | 391 | * This function is called by recursive_action on each file during |
392 | * the directory traversal. | 392 | * the directory traversal. |
393 | */ | 393 | */ |
394 | static int apply_spec( | 394 | static int FAST_FUNC apply_spec( |
395 | const char *file, | 395 | const char *file, |
396 | struct stat *sb, | 396 | struct stat *sb, |
397 | void *userData ATTRIBUTE_UNUSED, | 397 | void *userData ATTRIBUTE_UNUSED, |
diff --git a/shell/hush.c b/shell/hush.c index 032482c6d..72186f970 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -498,7 +498,7 @@ static void syntax(const char *msg) | |||
498 | /* Was using fancy stuff: | 498 | /* Was using fancy stuff: |
499 | * (interactive_fd ? bb_error_msg : bb_error_msg_and_die)(...params...) | 499 | * (interactive_fd ? bb_error_msg : bb_error_msg_and_die)(...params...) |
500 | * but it SEGVs. ?! Oh well... explicit temp ptr works around that */ | 500 | * but it SEGVs. ?! Oh well... explicit temp ptr works around that */ |
501 | void (*fp)(const char *s, ...); | 501 | void FAST_FUNC (*fp)(const char *s, ...); |
502 | 502 | ||
503 | fp = (interactive_fd ? bb_error_msg : bb_error_msg_and_die); | 503 | fp = (interactive_fd ? bb_error_msg : bb_error_msg_and_die); |
504 | fp(msg ? "%s: %s" : "syntax error", "syntax error", msg); | 504 | fp(msg ? "%s: %s" : "syntax error", "syntax error", msg); |
diff --git a/shell/lash_unused.c b/shell/lash_unused.c index d57f584b2..59199ded4 100644 --- a/shell/lash_unused.c +++ b/shell/lash_unused.c | |||
@@ -116,11 +116,11 @@ static int builtin_read(struct child_prog *cmd); | |||
116 | /* function prototypes for shell stuff */ | 116 | /* function prototypes for shell stuff */ |
117 | static void checkjobs(struct jobset *job_list); | 117 | static void checkjobs(struct jobset *job_list); |
118 | static void remove_job(struct jobset *j_list, struct job *job); | 118 | static void remove_job(struct jobset *j_list, struct job *job); |
119 | static int get_command_bufsiz(FILE * source, char *command); | 119 | static int get_command_bufsiz(FILE *source, char *command); |
120 | static int parse_command(char **command_ptr, struct job *job, int *inbg); | 120 | static int parse_command(char **command_ptr, struct job *job, int *inbg); |
121 | static int run_command(struct job *newjob, int inbg, int outpipe[2]); | 121 | static int run_command(struct job *newjob, int inbg, int outpipe[2]); |
122 | static int pseudo_exec(struct child_prog *cmd) ATTRIBUTE_NORETURN; | 122 | static int pseudo_exec(struct child_prog *cmd) ATTRIBUTE_NORETURN; |
123 | static int busy_loop(FILE * input); | 123 | static int busy_loop(FILE *input); |
124 | 124 | ||
125 | 125 | ||
126 | /* Table of built-in functions (these are non-forking builtins, meaning they | 126 | /* Table of built-in functions (these are non-forking builtins, meaning they |
@@ -643,7 +643,7 @@ static inline const char* setup_prompt_string(void) | |||
643 | static line_input_t *line_input_state; | 643 | static line_input_t *line_input_state; |
644 | #endif | 644 | #endif |
645 | 645 | ||
646 | static int get_command_bufsiz(FILE * source, char *command) | 646 | static int get_command_bufsiz(FILE *source, char *command) |
647 | { | 647 | { |
648 | const char *prompt_str; | 648 | const char *prompt_str; |
649 | 649 | ||
@@ -1326,7 +1326,7 @@ static int run_command(struct job *newjob, int inbg, int outpipe[2]) | |||
1326 | return 0; | 1326 | return 0; |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | static int busy_loop(FILE * input) | 1329 | static int busy_loop(FILE *input) |
1330 | { | 1330 | { |
1331 | char *command; | 1331 | char *command; |
1332 | char *next_command = NULL; | 1332 | char *next_command = NULL; |
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index e1edd2073..bacccc02f 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
@@ -299,7 +299,7 @@ static void make_device(char *path, int delete) | |||
299 | } | 299 | } |
300 | 300 | ||
301 | /* File callback for /sys/ traversal */ | 301 | /* File callback for /sys/ traversal */ |
302 | static int fileAction(const char *fileName, | 302 | static int FAST_FUNC fileAction(const char *fileName, |
303 | struct stat *statbuf ATTRIBUTE_UNUSED, | 303 | struct stat *statbuf ATTRIBUTE_UNUSED, |
304 | void *userData, | 304 | void *userData, |
305 | int depth ATTRIBUTE_UNUSED) | 305 | int depth ATTRIBUTE_UNUSED) |
@@ -319,7 +319,7 @@ static int fileAction(const char *fileName, | |||
319 | } | 319 | } |
320 | 320 | ||
321 | /* Directory callback for /sys/ traversal */ | 321 | /* Directory callback for /sys/ traversal */ |
322 | static int dirAction(const char *fileName ATTRIBUTE_UNUSED, | 322 | static int FAST_FUNC dirAction(const char *fileName ATTRIBUTE_UNUSED, |
323 | struct stat *statbuf ATTRIBUTE_UNUSED, | 323 | struct stat *statbuf ATTRIBUTE_UNUSED, |
324 | void *userData ATTRIBUTE_UNUSED, | 324 | void *userData ATTRIBUTE_UNUSED, |
325 | int depth) | 325 | int depth) |