*: introduce and use FAST_FUNC: regparm on i386, otherwise no-on

text    data     bss     dec     hex filename
 808035     611    6868  815514   c719a busybox_old
 804472     611    6868  811951   c63af busybox_unstripped
This commit is contained in:
Denis Vlasenko 2008-06-27 02:52:20 +00:00
parent 26bc57d8b2
commit defc1ea340
176 changed files with 844 additions and 838 deletions

View File

@ -16,7 +16,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
static void header_verbose_list_ar(const file_header_t *file_header) static void FAST_FUNC header_verbose_list_ar(const file_header_t *file_header)
{ {
const char *mode = bb_mode_string(file_header->mode); const char *mode = bb_mode_string(file_header->mode);
char *mtime; char *mtime;

View File

@ -28,7 +28,7 @@ int open_to_or_warn(int to_fd, const char *filename, int flags, int mode)
return 0; return 0;
} }
int bbunpack(char **argv, int FAST_FUNC bbunpack(char **argv,
char* (*make_new_name)(char *filename), char* (*make_new_name)(char *filename),
USE_DESKTOP(long long) int (*unpacker)(void) USE_DESKTOP(long long) int (*unpacker)(void)
) )

View File

@ -1482,7 +1482,7 @@ static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, lli
return ar_handle->sub_archive->buffer; return ar_handle->sub_archive->buffer;
} }
static void data_extract_all_prefix(archive_handle_t *archive_handle) static void FAST_FUNC data_extract_all_prefix(archive_handle_t *archive_handle)
{ {
char *name_ptr = archive_handle->file_header->name; char *name_ptr = archive_handle->file_header->name;

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, ssize_t FAST_FUNC archive_xread_all_eof(archive_handle_t *archive_handle,
unsigned char *buf, size_t count) unsigned char *buf, size_t count)
{ {
ssize_t size; ssize_t size;

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void data_align(archive_handle_t *archive_handle, unsigned boundary) void FAST_FUNC data_align(archive_handle_t *archive_handle, unsigned boundary)
{ {
unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary; unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary;

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void data_extract_all(archive_handle_t *archive_handle) void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
{ {
file_header_t *file_header = archive_handle->file_header; file_header_t *file_header = archive_handle->file_header;
int dst_fd; int dst_fd;

View File

@ -8,7 +8,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void data_extract_to_buffer(archive_handle_t *archive_handle) void FAST_FUNC data_extract_to_buffer(archive_handle_t *archive_handle)
{ {
unsigned int size = archive_handle->file_header->size; unsigned int size = archive_handle->file_header->size;

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void data_extract_to_stdout(archive_handle_t *archive_handle) void FAST_FUNC data_extract_to_stdout(archive_handle_t *archive_handle)
{ {
bb_copyfd_exact_size(archive_handle->src_fd, bb_copyfd_exact_size(archive_handle->src_fd,
STDOUT_FILENO, STDOUT_FILENO,

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void data_skip(archive_handle_t *archive_handle) void FAST_FUNC data_skip(archive_handle_t *archive_handle)
{ {
archive_handle->seek(archive_handle, archive_handle->file_header->size); archive_handle->seek(archive_handle, archive_handle->file_header->size);
} }

View File

@ -526,7 +526,7 @@ static int get_next_block(bunzip_data *bd)
are ignored, data is written to out_fd and return is RETVAL_OK or error. are ignored, data is written to out_fd and return is RETVAL_OK or error.
*/ */
int read_bunzip(bunzip_data *bd, char *outbuf, int len) int FAST_FUNC read_bunzip(bunzip_data *bd, char *outbuf, int len)
{ {
const unsigned *dbuf; const unsigned *dbuf;
int pos, current, previous, gotcount; int pos, current, previous, gotcount;
@ -643,7 +643,7 @@ int read_bunzip(bunzip_data *bd, char *outbuf, int len)
should work for NOFORK applets too, we must be extremely careful to not leak should work for NOFORK applets too, we must be extremely careful to not leak
any allocations! */ any allocations! */
int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf, int FAST_FUNC start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf,
int len) int len)
{ {
bunzip_data *bd; bunzip_data *bd;
@ -699,7 +699,7 @@ int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf,
return RETVAL_OK; return RETVAL_OK;
} }
void dealloc_bunzip(bunzip_data *bd) void FAST_FUNC dealloc_bunzip(bunzip_data *bd)
{ {
free(bd->dbuf); free(bd->dbuf);
free(bd); free(bd);
@ -708,7 +708,7 @@ void dealloc_bunzip(bunzip_data *bd)
/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */ /* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */
USE_DESKTOP(long long) int USE_DESKTOP(long long) int FAST_FUNC
unpack_bz2_stream(int src_fd, int dst_fd) unpack_bz2_stream(int src_fd, int dst_fd)
{ {
USE_DESKTOP(long long total_written = 0;) USE_DESKTOP(long long total_written = 0;)

View File

@ -70,7 +70,7 @@
* be stored in the compressed file. * be stored in the compressed file.
*/ */
USE_DESKTOP(long long) int USE_DESKTOP(long long) int FAST_FUNC
uncompress(int fd_in, int fd_out) uncompress(int fd_in, int fd_out)
{ {
USE_DESKTOP(long long total_written = 0;) USE_DESKTOP(long long total_written = 0;)

View File

@ -229,7 +229,7 @@ enum {
}; };
USE_DESKTOP(long long) int USE_DESKTOP(long long) int FAST_FUNC
unpack_lzma_stream(int src_fd, int dst_fd) unpack_lzma_stream(int src_fd, int dst_fd)
{ {
USE_DESKTOP(long long total_written = 0;) USE_DESKTOP(long long total_written = 0;)

View File

@ -1033,7 +1033,7 @@ inflate_unzip_internal(STATE_PARAM int in, int out)
/* For unzip */ /* For unzip */
USE_DESKTOP(long long) int USE_DESKTOP(long long) int FAST_FUNC
inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out) inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out)
{ {
USE_DESKTOP(long long) int n; USE_DESKTOP(long long) int n;
@ -1176,7 +1176,7 @@ static int check_header_gzip(STATE_PARAM_ONLY)
return 1; return 1;
} }
USE_DESKTOP(long long) int USE_DESKTOP(long long) int FAST_FUNC
unpack_gz_stream(int in, int out) unpack_gz_stream(int in, int out)
{ {
uint32_t v32; uint32_t v32;

View File

@ -9,7 +9,7 @@
#include "unarchive.h" #include "unarchive.h"
/* Accept any non-null name, its not really a filter at all */ /* Accept any non-null name, its not really a filter at all */
char filter_accept_all(archive_handle_t *archive_handle) char FAST_FUNC filter_accept_all(archive_handle_t *archive_handle)
{ {
if (archive_handle->file_header->name) if (archive_handle->file_header->name)
return EXIT_SUCCESS; return EXIT_SUCCESS;

View File

@ -11,7 +11,7 @@
/* /*
* Accept names that are in the accept list, ignoring reject list. * Accept names that are in the accept list, ignoring reject list.
*/ */
char filter_accept_list(archive_handle_t *archive_handle) char FAST_FUNC filter_accept_list(archive_handle_t *archive_handle)
{ {
if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) if (find_list_entry(archive_handle->accept, archive_handle->file_header->name))
return EXIT_SUCCESS; return EXIT_SUCCESS;

View File

@ -13,7 +13,7 @@
* e.g. if its a .tar.gz modify archive_handle->sub_archive to process a .tar.gz * e.g. if its a .tar.gz modify archive_handle->sub_archive to process a .tar.gz
* or if its a .tar.bz2 make archive_handle->sub_archive handle that * or if its a .tar.bz2 make archive_handle->sub_archive handle that
*/ */
char filter_accept_list_reassign(archive_handle_t *archive_handle) char FAST_FUNC filter_accept_list_reassign(archive_handle_t *archive_handle)
{ {
/* Check the file entry is in the accept list */ /* Check the file entry is in the accept list */
if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) { if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) {

View File

@ -11,7 +11,7 @@
/* /*
* Accept names that are in the accept list and not in the reject list * Accept names that are in the accept list and not in the reject list
*/ */
char filter_accept_reject_list(archive_handle_t *archive_handle) char FAST_FUNC filter_accept_reject_list(archive_handle_t *archive_handle)
{ {
const char *key; const char *key;
const llist_t *reject_entry; const llist_t *reject_entry;

View File

@ -10,7 +10,7 @@
#include "unarchive.h" #include "unarchive.h"
/* Find a string in a shell pattern list */ /* Find a string in a shell pattern list */
const llist_t *find_list_entry(const llist_t *list, const char *filename) const llist_t* FAST_FUNC find_list_entry(const llist_t *list, const char *filename)
{ {
while (list) { while (list) {
if (fnmatch(list->data, filename, 0) == 0) { if (fnmatch(list->data, filename, 0) == 0) {
@ -24,7 +24,7 @@ const llist_t *find_list_entry(const llist_t *list, const char *filename)
/* Same, but compares only path components present in pattern /* Same, but compares only path components present in pattern
* (extra trailing path components in filename are assumed to match) * (extra trailing path components in filename are assumed to match)
*/ */
const llist_t *find_list_entry2(const llist_t *list, const char *filename) const llist_t* FAST_FUNC find_list_entry2(const llist_t *list, const char *filename)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
int pattern_slash_cnt; int pattern_slash_cnt;

View File

@ -7,7 +7,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
char get_header_ar(archive_handle_t *archive_handle) char FAST_FUNC get_header_ar(archive_handle_t *archive_handle)
{ {
int err; int err;
file_header_t *typed = archive_handle->file_header; file_header_t *typed = archive_handle->file_header;

View File

@ -17,7 +17,7 @@ typedef struct hardlinks_s {
char name[1]; char name[1];
} hardlinks_t; } hardlinks_t;
char get_header_cpio(archive_handle_t *archive_handle) char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
{ {
static hardlinks_t *saved_hardlinks = NULL; static hardlinks_t *saved_hardlinks = NULL;
static hardlinks_t *saved_hardlinks_created = NULL; static hardlinks_t *saved_hardlinks_created = NULL;

View File

@ -43,7 +43,7 @@ static unsigned long long getOctal(char *str, int len)
#define GET_OCTAL(a) getOctal((a), sizeof(a)) #define GET_OCTAL(a) getOctal((a), sizeof(a))
void BUG_tar_header_size(void); void BUG_tar_header_size(void);
char get_header_tar(archive_handle_t *archive_handle) char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
{ {
static smallint end; static smallint end;
#if ENABLE_FEATURE_TAR_AUTODETECT #if ENABLE_FEATURE_TAR_AUTODETECT
@ -133,7 +133,7 @@ char get_header_tar(archive_handle_t *archive_handle)
|| memcmp(tar.magic, "\0\0\0\0", 5) != 0) || memcmp(tar.magic, "\0\0\0\0", 5) != 0)
) { ) {
#if ENABLE_FEATURE_TAR_AUTODETECT #if ENABLE_FEATURE_TAR_AUTODETECT
char (*get_header_ptr)(archive_handle_t *); char FAST_FUNC (*get_header_ptr)(archive_handle_t *);
/* tar gz/bz autodetect: check for gz/bz2 magic. /* tar gz/bz autodetect: check for gz/bz2 magic.
* If it is the very first block, and we see the magic, * If it is the very first block, and we see the magic,

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
char get_header_tar_bz2(archive_handle_t *archive_handle) char FAST_FUNC get_header_tar_bz2(archive_handle_t *archive_handle)
{ {
/* Can't lseek over pipes */ /* Can't lseek over pipes */
archive_handle->seek = seek_by_read; archive_handle->seek = seek_by_read;

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
char get_header_tar_gz(archive_handle_t *archive_handle) char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
{ {
#if BB_MMU #if BB_MMU
unsigned char magic[2]; unsigned char magic[2];

View File

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
char get_header_tar_lzma(archive_handle_t * archive_handle) char FAST_FUNC get_header_tar_lzma(archive_handle_t * archive_handle)
{ {
/* Can't lseek over pipes */ /* Can't lseek over pipes */
archive_handle->seek = seek_by_read; archive_handle->seek = seek_by_read;

View File

@ -5,7 +5,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void header_list(const file_header_t *file_header) void FAST_FUNC header_list(const file_header_t *file_header)
{ {
puts(file_header->name); puts(file_header->name);
} }

View File

@ -5,6 +5,6 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED) void FAST_FUNC header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED)
{ {
} }

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void header_verbose_list(const file_header_t *file_header) void FAST_FUNC header_verbose_list(const file_header_t *file_header)
{ {
struct tm *mtime = localtime(&(file_header->mtime)); struct tm *mtime = localtime(&(file_header->mtime));

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
archive_handle_t *init_handle(void) archive_handle_t* FAST_FUNC init_handle(void)
{ {
archive_handle_t *archive_handle; archive_handle_t *archive_handle;

View File

@ -11,8 +11,8 @@
* On MMU machine, the transform_prog is removed by macro magic * On MMU machine, the transform_prog is removed by macro magic
* in include/unarchive.h. On NOMMU, transformer is removed. * in include/unarchive.h. On NOMMU, transformer is removed.
*/ */
int open_transformer(int src_fd, int FAST_FUNC open_transformer(int src_fd,
USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd), USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd),
const char *transform_prog) const char *transform_prog)
{ {
struct fd_pair fd_pipe; struct fd_pair fd_pipe;

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount) void FAST_FUNC seek_by_jump(const archive_handle_t *archive_handle, unsigned amount)
{ {
if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) { if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) {
if (errno == ESPIPE) if (errno == ESPIPE)

View File

@ -9,7 +9,7 @@
/* If we are reading through a pipe, or from stdin then we can't lseek, /* If we are reading through a pipe, or from stdin then we can't lseek,
* we must read and discard the data to skip over it. * we must read and discard the data to skip over it.
*/ */
void seek_by_read(const archive_handle_t *archive_handle, unsigned jump_size) void FAST_FUNC seek_by_read(const archive_handle_t *archive_handle, unsigned jump_size)
{ {
if (jump_size) if (jump_size)
bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size); bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size);

View File

@ -6,7 +6,7 @@
#include "libbb.h" #include "libbb.h"
#include "unarchive.h" #include "unarchive.h"
void unpack_ar_archive(archive_handle_t *ar_archive) void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive)
{ {
char magic[7]; char magic[7];

View File

@ -190,7 +190,7 @@ static void extract_cpio_gz(int fd)
archive_handle_t *archive_handle; archive_handle_t *archive_handle;
unsigned char magic[2]; unsigned char magic[2];
#if BB_MMU #if BB_MMU
USE_DESKTOP(long long) int (*xformer)(int src_fd, int dst_fd); USE_DESKTOP(long long) int FAST_FUNC (*xformer)(int src_fd, int dst_fd);
enum { xformer_prog = 0 }; enum { xformer_prog = 0 };
#else #else
enum { xformer = 0 }; enum { xformer = 0 };

View File

@ -396,7 +396,7 @@ static int exclude_file(const llist_t *excluded_files, const char *file)
#define exclude_file(excluded_files, file) 0 #define exclude_file(excluded_files, file) 0
#endif #endif
static int writeFileToTarball(const char *fileName, struct stat *statbuf, static int FAST_FUNC writeFileToTarball(const char *fileName, struct stat *statbuf,
void *userData, int depth ATTRIBUTE_UNUSED) void *userData, int depth ATTRIBUTE_UNUSED)
{ {
struct TarBallInfo *tbInfo = (struct TarBallInfo *) userData; struct TarBallInfo *tbInfo = (struct TarBallInfo *) userData;
@ -680,7 +680,7 @@ static llist_t *append_file_list_to_list(llist_t *list)
#endif #endif
#if ENABLE_FEATURE_TAR_COMPRESS #if ENABLE_FEATURE_TAR_COMPRESS
static char get_header_tar_Z(archive_handle_t *archive_handle) static char FAST_FUNC get_header_tar_Z(archive_handle_t *archive_handle)
{ {
/* Can't lseek over pipes */ /* Can't lseek over pipes */
archive_handle->seek = seek_by_read; archive_handle->seek = seek_by_read;
@ -802,7 +802,7 @@ static const char tar_longopts[] ALIGN1 =
int tar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int tar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int tar_main(int argc ATTRIBUTE_UNUSED, char **argv) int tar_main(int argc ATTRIBUTE_UNUSED, char **argv)
{ {
char (*get_header_ptr)(archive_handle_t *) = get_header_tar; char FAST_FUNC (*get_header_ptr)(archive_handle_t *) = get_header_tar;
archive_handle_t *tar_handle; archive_handle_t *tar_handle;
char *base_dir = NULL; char *base_dir = NULL;
const char *tar_filename = "-"; const char *tar_filename = "-";

View File

@ -34,7 +34,7 @@
* symbolic links encountered during recursive directory traversals. * symbolic links encountered during recursive directory traversals.
*/ */
static int fileAction(const char *fileName, struct stat *statbuf, void* param, int depth) static int FAST_FUNC fileAction(const char *fileName, struct stat *statbuf, void* param, int depth)
{ {
mode_t newmode; mode_t newmode;

View File

@ -41,7 +41,7 @@ typedef int (*chown_fptr)(const char *, uid_t, gid_t);
static struct bb_uidgid_t ugid = { -1, -1 }; static struct bb_uidgid_t ugid = { -1, -1 };
static int fileAction(const char *fileName, struct stat *statbuf, static int FAST_FUNC fileAction(const char *fileName, struct stat *statbuf,
void *cf, int depth ATTRIBUTE_UNUSED) void *cf, int depth ATTRIBUTE_UNUSED)
{ {
uid_t u = (ugid.uid == (uid_t)-1) ? statbuf->st_uid : ugid.uid; uid_t u = (ugid.uid == (uid_t)-1) ? statbuf->st_uid : ugid.uid;

View File

@ -152,7 +152,7 @@ int uudecode_main(int argc ATTRIBUTE_UNUSED, char **argv)
/* Search for the start of the encoding */ /* Search for the start of the encoding */
while ((line = xmalloc_fgetline(src_stream)) != NULL) { while ((line = xmalloc_fgetline(src_stream)) != NULL) {
void (*decode_fn_ptr)(FILE * src, FILE * dst); void (*decode_fn_ptr)(FILE *src, FILE *dst);
char *line_ptr; char *line_ptr;
FILE *dst_stream; FILE *dst_stream;
int mode; int mode;

View File

@ -77,7 +77,7 @@ static int bb_alphasort(const void *p1, const void *p2)
return (option_mask32 & OPT_r) ? -r : r; return (option_mask32 & OPT_r) ? -r : r;
} }
static int act(const char *file, struct stat *statbuf, void *args ATTRIBUTE_UNUSED, int depth) static int FAST_FUNC act(const char *file, struct stat *statbuf, void *args ATTRIBUTE_UNUSED, int depth)
{ {
if (depth == 1) if (depth == 1)
return TRUE; return TRUE;

View File

@ -37,9 +37,9 @@ int iterate_on_dir (const char * dir_name,
/*void list_super(struct ext2_super_block * s);*/ /*void list_super(struct ext2_super_block * s);*/
void list_super2(struct ext2_super_block * s, FILE *f); void list_super2(struct ext2_super_block * s, FILE *f);
#define list_super(s) list_super2(s, stdout) #define list_super(s) list_super2(s, stdout)
void print_fs_errors (FILE * f, unsigned short errors); void print_fs_errors (FILE *f, unsigned short errors);
void print_flags (FILE * f, unsigned long flags, unsigned options); void print_flags (FILE *f, unsigned long flags, unsigned options);
void print_fs_state (FILE * f, unsigned short state); void print_fs_state (FILE *f, unsigned short state);
int setflags (int fd, unsigned long flags); int setflags (int fd, unsigned long flags);
int setversion (int fd, unsigned long version); int setversion (int fd, unsigned long version);

View File

@ -48,7 +48,7 @@ static const struct flags_name flags_array[] = {
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
void print_flags (FILE * f, unsigned long flags, unsigned options) void print_flags (FILE *f, unsigned long flags, unsigned options)
{ {
int long_opt = (options & PFOPT_LONG); int long_opt = (options & PFOPT_LONG);
const struct flags_name *fp; const struct flags_name *fp;

View File

@ -1163,7 +1163,7 @@ static void do_diff(char *dir1, char *path1, char *dir2, char *path2)
#if ENABLE_FEATURE_DIFF_DIR #if ENABLE_FEATURE_DIFF_DIR
/* This function adds a filename to dl, the directory listing. */ /* This function adds a filename to dl, the directory listing. */
static int add_to_dirlist(const char *filename, static int FAST_FUNC add_to_dirlist(const char *filename,
struct stat *sb ATTRIBUTE_UNUSED, struct stat *sb ATTRIBUTE_UNUSED,
void *userdata, void *userdata,
int depth ATTRIBUTE_UNUSED) int depth ATTRIBUTE_UNUSED)

View File

@ -23,7 +23,7 @@
resulting sed_cmd_t structures are appended to a linked list resulting sed_cmd_t structures are appended to a linked list
(G.sed_cmd_head/G.sed_cmd_tail). (G.sed_cmd_head/G.sed_cmd_tail).
add_input_file() adds a FILE * to the list of input files. We need to add_input_file() adds a FILE* to the list of input files. We need to
know all input sources ahead of time to find the last line for the $ match. know all input sources ahead of time to find the last line for the $ match.
process_files() does actual sedding, reading data lines from each input FILE * process_files() does actual sedding, reading data lines from each input FILE *

View File

@ -1659,12 +1659,12 @@ static char *char_insert(char *p, char c) // insert the char c at 'p'
cmdcnt = 0; cmdcnt = 0;
end_cmd_q(); // stop adding to q end_cmd_q(); // stop adding to q
last_status_cksum = 0; // force status update last_status_cksum = 0; // force status update
if ((p > text) && (p[-1] != '\n')) { if ((p[-1] != '\n') && (dot > text)) {
p--; p--;
} }
} else if (c == erase_char || c == 8 || c == 127) { // Is this a BS } else if (c == erase_char || c == 8 || c == 127) { // Is this a BS
// 123456789 // 123456789
if ((p > text) && (p[-1] != '\n')) { if ((p[-1] != '\n') && (dot>text)) {
p--; p--;
p = text_hole_delete(p, p); // shrink buffer 1 char p = text_hole_delete(p, p); // shrink buffer 1 char
} }

View File

@ -374,7 +374,7 @@ ACTF(context)
#endif #endif
static int fileAction(const char *fileName, static int FAST_FUNC fileAction(const char *fileName,
struct stat *statbuf, struct stat *statbuf,
void *userData SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED), void *userData SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED),
int depth SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED)) int depth SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED))

View File

@ -370,7 +370,7 @@ static void load_regexes_from_file(llist_t *fopt)
} }
} }
static int file_action_grep(const char *filename, static int FAST_FUNC file_action_grep(const char *filename,
struct stat *statbuf ATTRIBUTE_UNUSED, struct stat *statbuf ATTRIBUTE_UNUSED,
void* matched, void* matched,
int depth ATTRIBUTE_UNUSED) int depth ATTRIBUTE_UNUSED)

View File

@ -44,9 +44,9 @@ typedef struct _fs { /* format strings */
int bcnt; int bcnt;
} FS; } FS;
extern void bb_dump_add(const char *fmt); extern void bb_dump_add(const char *fmt) FAST_FUNC;
extern int bb_dump_dump(char **argv); extern int bb_dump_dump(char **argv) FAST_FUNC;
extern int bb_dump_size(FS * fs); extern int bb_dump_size(FS * fs) FAST_FUNC;
extern FS *bb_dump_fshead; /* head of format strings */ extern FS *bb_dump_fshead; /* head of format strings */
extern int bb_dump_blocksize; /* data block size */ extern int bb_dump_blocksize; /* data block size */

View File

@ -12,15 +12,15 @@
/* hostfirst!=0 If we expect this to be a hostname, /* hostfirst!=0 If we expect this to be a hostname,
try hostname database first try hostname database first
*/ */
int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst); int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) FAST_FUNC;
/* numeric: & 0x8000: "default" instead of "*", /* numeric: & 0x8000: "default" instead of "*",
* & 0x4000: host instead of net, * & 0x4000: host instead of net,
* & 0x0fff: don't resolve * & 0x0fff: don't resolve
*/ */
int INET6_resolve(const char *name, struct sockaddr_in6 *sin6); int INET6_resolve(const char *name, struct sockaddr_in6 *sin6) FAST_FUNC;
/* These return malloced string */ /* These return malloced string */
char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask); char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) FAST_FUNC;
char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric); char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) FAST_FUNC;

File diff suppressed because it is too large Load Diff

View File

@ -97,6 +97,13 @@
# endif # endif
#endif #endif
#if __GNUC_PREREQ(3,0) && defined(i386)
/* || defined(__x86_64__)? */
# define FAST_FUNC __attribute__((regparm(3)))
#else
# define FAST_FUNC
#endif
/* ---- Endian Detection ------------------------------------ */ /* ---- Endian Detection ------------------------------------ */
#if (defined __digital__ && defined __unix__) #if (defined __digital__ && defined __unix__)

View File

@ -13,9 +13,9 @@
# pragma GCC visibility push(hidden) # pragma GCC visibility push(hidden)
#endif #endif
extern int rtc_adjtime_is_utc(void); extern int rtc_adjtime_is_utc(void) FAST_FUNC;
extern int rtc_xopen(const char **default_rtc, int flags); extern int rtc_xopen(const char **default_rtc, int flags) FAST_FUNC;
extern time_t rtc_read_time(int fd, int utc); extern time_t rtc_read_time(int fd, int utc) FAST_FUNC;
/* /*
* Everything below this point has been copied from linux/rtc.h * Everything below this point has been copied from linux/rtc.h

View File

@ -31,7 +31,7 @@ typedef struct file_header_t {
typedef struct archive_handle_t { typedef struct archive_handle_t {
/* define if the header and data component should be processed */ /* define if the header and data component should be processed */
char (*filter)(struct archive_handle_t *); char FAST_FUNC (*filter)(struct archive_handle_t *);
llist_t *accept; llist_t *accept;
/* List of files that have been rejected */ /* List of files that have been rejected */
llist_t *reject; llist_t *reject;
@ -42,13 +42,13 @@ typedef struct archive_handle_t {
file_header_t *file_header; file_header_t *file_header;
/* process the header component, e.g. tar -t */ /* process the header component, e.g. tar -t */
void (*action_header)(const file_header_t *); void FAST_FUNC (*action_header)(const file_header_t *);
/* process the data component, e.g. extract to filesystem */ /* process the data component, e.g. extract to filesystem */
void (*action_data)(struct archive_handle_t *); void FAST_FUNC (*action_data)(struct archive_handle_t *);
/* How to process any sub archive, e.g. get_header_tar_gz */ /* How to process any sub archive, e.g. get_header_tar_gz */
char (*action_data_subarchive)(struct archive_handle_t *); char FAST_FUNC (*action_data_subarchive)(struct archive_handle_t *);
/* Contains the handle to a sub archive */ /* Contains the handle to a sub archive */
struct archive_handle_t *sub_archive; struct archive_handle_t *sub_archive;
@ -60,7 +60,7 @@ typedef struct archive_handle_t {
off_t offset; off_t offset;
/* Function that skips data: read_by_char or read_by_skip */ /* Function that skips data: read_by_char or read_by_skip */
void (*seek)(const struct archive_handle_t *archive_handle, const unsigned amount); void FAST_FUNC (*seek)(const struct archive_handle_t *archive_handle, const unsigned amount);
/* Temporary storage */ /* Temporary storage */
char *buffer; char *buffer;
@ -71,62 +71,62 @@ typedef struct archive_handle_t {
} archive_handle_t; } archive_handle_t;
extern archive_handle_t *init_handle(void); extern archive_handle_t *init_handle(void) FAST_FUNC;
extern char filter_accept_all(archive_handle_t *archive_handle); extern char filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC;
extern char filter_accept_list(archive_handle_t *archive_handle); extern char filter_accept_list(archive_handle_t *archive_handle) FAST_FUNC;
extern char filter_accept_list_reassign(archive_handle_t *archive_handle); extern char filter_accept_list_reassign(archive_handle_t *archive_handle) FAST_FUNC;
extern char filter_accept_reject_list(archive_handle_t *archive_handle); extern char filter_accept_reject_list(archive_handle_t *archive_handle) FAST_FUNC;
extern void unpack_ar_archive(archive_handle_t *ar_archive); extern void unpack_ar_archive(archive_handle_t *ar_archive) FAST_FUNC;
extern void data_skip(archive_handle_t *archive_handle); extern void data_skip(archive_handle_t *archive_handle) FAST_FUNC;
extern void data_extract_all(archive_handle_t *archive_handle); extern void data_extract_all(archive_handle_t *archive_handle) FAST_FUNC;
extern void data_extract_to_stdout(archive_handle_t *archive_handle); extern void data_extract_to_stdout(archive_handle_t *archive_handle) FAST_FUNC;
extern void data_extract_to_buffer(archive_handle_t *archive_handle); extern void data_extract_to_buffer(archive_handle_t *archive_handle) FAST_FUNC;
extern void header_skip(const file_header_t *file_header); extern void header_skip(const file_header_t *file_header) FAST_FUNC;
extern void header_list(const file_header_t *file_header); extern void header_list(const file_header_t *file_header) FAST_FUNC;
extern void header_verbose_list(const file_header_t *file_header); extern void header_verbose_list(const file_header_t *file_header) FAST_FUNC;
extern char get_header_ar(archive_handle_t *archive_handle); extern char get_header_ar(archive_handle_t *archive_handle) FAST_FUNC;
extern char get_header_cpio(archive_handle_t *archive_handle); extern char get_header_cpio(archive_handle_t *archive_handle) FAST_FUNC;
extern char get_header_tar(archive_handle_t *archive_handle); extern char get_header_tar(archive_handle_t *archive_handle) FAST_FUNC;
extern char get_header_tar_bz2(archive_handle_t *archive_handle); extern char get_header_tar_bz2(archive_handle_t *archive_handle) FAST_FUNC;
extern char get_header_tar_lzma(archive_handle_t *archive_handle); extern char get_header_tar_lzma(archive_handle_t *archive_handle) FAST_FUNC;
extern char get_header_tar_gz(archive_handle_t *archive_handle); extern char get_header_tar_gz(archive_handle_t *archive_handle) FAST_FUNC;
extern void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount); extern void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount) FAST_FUNC;
extern void seek_by_read(const archive_handle_t *archive_handle, unsigned amount); extern void seek_by_read(const archive_handle_t *archive_handle, unsigned amount) FAST_FUNC;
extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned char *buf, size_t count); extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned char *buf, size_t count) FAST_FUNC;
extern void data_align(archive_handle_t *archive_handle, unsigned boundary); extern void data_align(archive_handle_t *archive_handle, unsigned boundary) FAST_FUNC;
extern const llist_t *find_list_entry(const llist_t *list, const char *filename); extern const llist_t *find_list_entry(const llist_t *list, const char *filename) FAST_FUNC;
extern const llist_t *find_list_entry2(const llist_t *list, const char *filename); extern const llist_t *find_list_entry2(const llist_t *list, const char *filename) FAST_FUNC;
/* A bit of bunzip2 internals are exposed for compressed help support: */ /* A bit of bunzip2 internals are exposed for compressed help support: */
typedef struct bunzip_data bunzip_data; typedef struct bunzip_data bunzip_data;
int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf, int len); int start_bunzip(bunzip_data **bdp, int in_fd, const unsigned char *inbuf, int len) FAST_FUNC;
int read_bunzip(bunzip_data *bd, char *outbuf, int len); int read_bunzip(bunzip_data *bd, char *outbuf, int len) FAST_FUNC;
void dealloc_bunzip(bunzip_data *bd); void dealloc_bunzip(bunzip_data *bd) FAST_FUNC;
typedef struct inflate_unzip_result { typedef struct inflate_unzip_result {
off_t bytes_out; off_t bytes_out;
uint32_t crc; uint32_t crc;
} inflate_unzip_result; } inflate_unzip_result;
extern USE_DESKTOP(long long) int unpack_bz2_stream(int src_fd, int dst_fd); extern USE_DESKTOP(long long) int unpack_bz2_stream(int src_fd, int dst_fd) FAST_FUNC;
extern USE_DESKTOP(long long) int inflate_unzip(inflate_unzip_result *res, off_t compr_size, int src_fd, int dst_fd); extern USE_DESKTOP(long long) int inflate_unzip(inflate_unzip_result *res, off_t compr_size, int src_fd, int dst_fd) FAST_FUNC;
extern USE_DESKTOP(long long) int unpack_gz_stream(int src_fd, int dst_fd); extern USE_DESKTOP(long long) int unpack_gz_stream(int src_fd, int dst_fd) FAST_FUNC;
extern USE_DESKTOP(long long) int unpack_lzma_stream(int src_fd, int dst_fd); extern USE_DESKTOP(long long) int unpack_lzma_stream(int src_fd, int dst_fd) FAST_FUNC;
#if BB_MMU #if BB_MMU
extern int open_transformer(int src_fd, extern int open_transformer(int src_fd,
USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd)); USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd)) FAST_FUNC;
#define open_transformer(src_fd, transformer, transform_prog) open_transformer(src_fd, transformer) #define open_transformer(src_fd, transformer, transform_prog) open_transformer(src_fd, transformer)
#else #else
extern int open_transformer(int src_fd, const char *transform_prog); extern int open_transformer(int src_fd, const char *transform_prog) FAST_FUNC;
#define open_transformer(src_fd, transformer, transform_prog) open_transformer(src_fd, transform_prog) #define open_transformer(src_fd, transformer, transform_prog) open_transformer(src_fd, transform_prog)
#endif #endif

View File

@ -14,20 +14,20 @@
/* Provides extern declarations of functions */ /* Provides extern declarations of functions */
#define DECLARE_STR_CONV(type, T, UT) \ #define DECLARE_STR_CONV(type, T, UT) \
\ \
unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \ unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx) FAST_FUNC; \
unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u); \ unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u) FAST_FUNC; \
unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx); \ unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx) FAST_FUNC; \
unsigned type xstrto##UT(const char *str, int b); \ unsigned type xstrto##UT(const char *str, int b) FAST_FUNC; \
unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \ unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx) FAST_FUNC; \
unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u); \ unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u) FAST_FUNC; \
unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx); \ unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \
unsigned type xato##UT(const char *str); \ unsigned type xato##UT(const char *str) FAST_FUNC; \
type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx); \ type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx) FAST_FUNC; \
type xstrto##T##_range(const char *str, int b, type l, type u); \ type xstrto##T##_range(const char *str, int b, type l, type u) FAST_FUNC; \
type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx); \ type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx) FAST_FUNC; \
type xato##T##_range(const char *str, type l, type u); \ type xato##T##_range(const char *str, type l, type u) FAST_FUNC; \
type xato##T##_sfx(const char *str, const struct suffix_mult *sfx); \ type xato##T##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \
type xato##T(const char *str); \ type xato##T(const char *str) FAST_FUNC; \
/* Unsigned long long functions always exist */ /* Unsigned long long functions always exist */
DECLARE_STR_CONV(long long, ll, ull) DECLARE_STR_CONV(long long, ll, ull)
@ -122,8 +122,8 @@ static ALWAYS_INLINE uint32_t xatou32(const char *numstr)
* return value is all-ones in this case. * return value is all-ones in this case.
*/ */
unsigned long long bb_strtoull(const char *arg, char **endp, int base); unsigned long long bb_strtoull(const char *arg, char **endp, int base) FAST_FUNC;
long long bb_strtoll(const char *arg, char **endp, int base); long long bb_strtoll(const char *arg, char **endp, int base) FAST_FUNC;
#if ULONG_MAX == ULLONG_MAX #if ULONG_MAX == ULLONG_MAX
static ALWAYS_INLINE static ALWAYS_INLINE
@ -133,8 +133,8 @@ static ALWAYS_INLINE
long bb_strtol(const char *arg, char **endp, int base) long bb_strtol(const char *arg, char **endp, int base)
{ return bb_strtoll(arg, endp, base); } { return bb_strtoll(arg, endp, base); }
#else #else
unsigned long bb_strtoul(const char *arg, char **endp, int base); unsigned long bb_strtoul(const char *arg, char **endp, int base) FAST_FUNC;
long bb_strtol(const char *arg, char **endp, int base); long bb_strtol(const char *arg, char **endp, int base) FAST_FUNC;
#endif #endif
#if UINT_MAX == ULLONG_MAX #if UINT_MAX == ULLONG_MAX
@ -152,8 +152,8 @@ static ALWAYS_INLINE
int bb_strtoi(const char *arg, char **endp, int base) int bb_strtoi(const char *arg, char **endp, int base)
{ return bb_strtol(arg, endp, base); } { return bb_strtol(arg, endp, base); }
#else #else
unsigned bb_strtou(const char *arg, char **endp, int base); unsigned bb_strtou(const char *arg, char **endp, int base) FAST_FUNC;
int bb_strtoi(const char *arg, char **endp, int base); int bb_strtoi(const char *arg, char **endp, int base) FAST_FUNC;
#endif #endif
int BUG_bb_strtou32_unimplemented(void); int BUG_bb_strtou32_unimplemented(void);

View File

@ -17,8 +17,8 @@
# pragma GCC visibility push(hidden) # pragma GCC visibility push(hidden)
#endif #endif
char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags); char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags) FAST_FUNC;
void xregcomp(regex_t *preg, const char *regex, int cflags); void xregcomp(regex_t *preg, const char *regex, int cflags) FAST_FUNC;
#if __GNUC_PREREQ(4,1) #if __GNUC_PREREQ(4,1)
# pragma GCC visibility pop # pragma GCC visibility pop

View File

@ -101,7 +101,7 @@ static void full_write2_str(const char *str)
full_write(STDERR_FILENO, str, strlen(str)); full_write(STDERR_FILENO, str, strlen(str));
} }
void bb_show_usage(void) void FAST_FUNC bb_show_usage(void)
{ {
if (ENABLE_SHOW_USAGE) { if (ENABLE_SHOW_USAGE) {
#ifdef SINGLE_APPLET_STR #ifdef SINGLE_APPLET_STR
@ -153,7 +153,7 @@ static int applet_name_compare(const void *name, const void *v)
return strcmp(name, APPLET_NAME(i)); return strcmp(name, APPLET_NAME(i));
} }
#endif #endif
int find_applet_by_name(const char *name) int FAST_FUNC find_applet_by_name(const char *name)
{ {
#if NUM_APPLETS > 8 #if NUM_APPLETS > 8
/* Do a binary search to find the applet entry given the name. */ /* Do a binary search to find the applet entry given the name. */
@ -704,7 +704,7 @@ static int busybox_main(char **argv)
xfunc_die(); xfunc_die();
} }
void run_applet_no_and_exit(int applet_no, char **argv) void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
{ {
int argc = 1; int argc = 1;
@ -722,7 +722,7 @@ void run_applet_no_and_exit(int applet_no, char **argv)
exit(applet_main[applet_no](argc, argv)); exit(applet_main[applet_no](argc, argv));
} }
void run_applet_and_exit(const char *name, char **argv) void FAST_FUNC run_applet_and_exit(const char *name, char **argv)
{ {
int applet = find_applet_by_name(name); int applet = find_applet_by_name(name);
if (applet >= 0) if (applet >= 0)

View File

@ -13,7 +13,7 @@
#include "libbb.h" #include "libbb.h"
int bb_ask_confirmation(void) int FAST_FUNC bb_ask_confirmation(void)
{ {
int retval = 0; int retval = 0;
int first = 1; int first = 1;

View File

@ -17,7 +17,7 @@ static void askpass_timeout(int ATTRIBUTE_UNUSED ignore)
{ {
} }
char *bb_askpass(int timeout, const char *prompt) char* FAST_FUNC bb_askpass(int timeout, const char *prompt)
{ {
/* Was static char[BIGNUM] */ /* Was static char[BIGNUM] */
enum { sizeof_passwd = 128 }; enum { sizeof_passwd = 128 };

View File

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
const char *bb_basename(const char *name) const char* FAST_FUNC bb_basename(const char *name)
{ {
const char *cp = strrchr(name, '/'); const char *cp = strrchr(name, '/');
if (cp) if (cp)

View File

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
void bb_do_delay(int seconds) void FAST_FUNC bb_do_delay(int seconds)
{ {
time_t start, now; time_t start, now;

View File

@ -45,7 +45,7 @@ static char* bb_getug(char *buffer, int bufsize, char *idname, long id, char pre
* bb_getXXXid(NULL, -1, id) - return user/group name or exit * bb_getXXXid(NULL, -1, id) - return user/group name or exit
*/ */
/* gets a username given a uid */ /* gets a username given a uid */
char* bb_getpwuid(char *name, int bufsize, long uid) char* FAST_FUNC bb_getpwuid(char *name, int bufsize, long uid)
{ {
struct passwd *myuser = getpwuid(uid); struct passwd *myuser = getpwuid(uid);
@ -54,7 +54,7 @@ char* bb_getpwuid(char *name, int bufsize, long uid)
uid, 'u'); uid, 'u');
} }
/* gets a groupname given a gid */ /* gets a groupname given a gid */
char* bb_getgrgid(char *group, int bufsize, long gid) char* FAST_FUNC bb_getgrgid(char *group, int bufsize, long gid)
{ {
struct group *mygroup = getgrgid(gid); struct group *mygroup = getgrgid(gid);
@ -64,7 +64,7 @@ char* bb_getgrgid(char *group, int bufsize, long gid)
} }
/* returns a gid given a group name */ /* returns a gid given a group name */
long xgroup2gid(const char *name) long FAST_FUNC xgroup2gid(const char *name)
{ {
struct group *mygroup; struct group *mygroup;
@ -76,7 +76,7 @@ long xgroup2gid(const char *name)
} }
/* returns a uid given a username */ /* returns a uid given a username */
long xuname2uid(const char *name) long FAST_FUNC xuname2uid(const char *name)
{ {
struct passwd *myuser; struct passwd *myuser;
@ -87,8 +87,8 @@ long xuname2uid(const char *name)
return myuser->pw_uid; return myuser->pw_uid;
} }
unsigned long get_ug_id(const char *s, unsigned long FAST_FUNC get_ug_id(const char *s,
long (*xname2id)(const char *)) long FAST_FUNC (*xname2id)(const char *))
{ {
unsigned long r; unsigned long r;

View File

@ -9,12 +9,12 @@
#include "libbb.h" #include "libbb.h"
int bb_pstrcmp(const void *a, const void *b) int /* not FAST_FUNC! */ bb_pstrcmp(const void *a, const void *b)
{ {
return strcmp(*(char**)a, *(char**)b); return strcmp(*(char**)a, *(char**)b);
} }
void qsort_string_vector(char **sv, unsigned count) void FAST_FUNC qsort_string_vector(char **sv, unsigned count)
{ {
qsort(sv, count, sizeof(char*), bb_pstrcmp); qsort(sv, count, sizeof(char*), bb_pstrcmp);
} }

View File

@ -48,7 +48,7 @@ static unsigned long long handle_errors(unsigned long long v, char **endp, char
} }
unsigned long long bb_strtoull(const char *arg, char **endp, int base) unsigned long long FAST_FUNC bb_strtoull(const char *arg, char **endp, int base)
{ {
unsigned long long v; unsigned long long v;
char *endptr; char *endptr;
@ -63,7 +63,7 @@ unsigned long long bb_strtoull(const char *arg, char **endp, int base)
return handle_errors(v, endp, endptr); return handle_errors(v, endp, endptr);
} }
long long bb_strtoll(const char *arg, char **endp, int base) long long FAST_FUNC bb_strtoll(const char *arg, char **endp, int base)
{ {
unsigned long long v; unsigned long long v;
char *endptr; char *endptr;
@ -75,7 +75,7 @@ long long bb_strtoll(const char *arg, char **endp, int base)
} }
#if ULONG_MAX != ULLONG_MAX #if ULONG_MAX != ULLONG_MAX
unsigned long bb_strtoul(const char *arg, char **endp, int base) unsigned long FAST_FUNC bb_strtoul(const char *arg, char **endp, int base)
{ {
unsigned long v; unsigned long v;
char *endptr; char *endptr;
@ -86,7 +86,7 @@ unsigned long bb_strtoul(const char *arg, char **endp, int base)
return handle_errors(v, endp, endptr); return handle_errors(v, endp, endptr);
} }
long bb_strtol(const char *arg, char **endp, int base) long FAST_FUNC bb_strtol(const char *arg, char **endp, int base)
{ {
long v; long v;
char *endptr; char *endptr;
@ -99,7 +99,7 @@ long bb_strtol(const char *arg, char **endp, int base)
#endif #endif
#if UINT_MAX != ULONG_MAX #if UINT_MAX != ULONG_MAX
unsigned bb_strtou(const char *arg, char **endp, int base) unsigned FAST_FUNC bb_strtou(const char *arg, char **endp, int base)
{ {
unsigned long v; unsigned long v;
char *endptr; char *endptr;
@ -111,7 +111,7 @@ unsigned bb_strtou(const char *arg, char **endp, int base)
return handle_errors(v, endp, endptr); return handle_errors(v, endp, endptr);
} }
int bb_strtoi(const char *arg, char **endp, int base) int FAST_FUNC bb_strtoi(const char *arg, char **endp, int base)
{ {
long v; long v;
char *endptr; char *endptr;
@ -131,7 +131,7 @@ int bb_strtoi(const char *arg, char **endp, int base)
#include <math.h> /* just for HUGE_VAL */ #include <math.h> /* just for HUGE_VAL */
#define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9) #define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9)
double bb_strtod(const char *arg, char **endp) double FAST_FUNC bb_strtod(const char *arg, char **endp)
{ {
double v; double v;
char *endptr; char *endptr;

View File

@ -31,7 +31,7 @@
#include "libbb.h" #include "libbb.h"
/* Become the user and group(s) specified by PW. */ /* Become the user and group(s) specified by PW. */
void change_identity(const struct passwd *pw) void FAST_FUNC change_identity(const struct passwd *pw)
{ {
if (initgroups(pw->pw_name, pw->pw_gid) == -1) if (initgroups(pw->pw_name, pw->pw_gid) == -1)
bb_perror_msg_and_die("can't set groups"); bb_perror_msg_and_die("can't set groups");

View File

@ -10,7 +10,7 @@
#include "libbb.h" #include "libbb.h"
void chomp(char *s) void FAST_FUNC chomp(char *s)
{ {
char *lc = last_char_is(s, '\n'); char *lc = last_char_is(s, '\n');

View File

@ -7,7 +7,7 @@
/* returns the array index of the string */ /* returns the array index of the string */
/* (index of first match is returned, or -1) */ /* (index of first match is returned, or -1) */
int index_in_str_array(const char *const string_array[], const char *key) int FAST_FUNC index_in_str_array(const char *const string_array[], const char *key)
{ {
int i; int i;
@ -19,7 +19,7 @@ int index_in_str_array(const char *const string_array[], const char *key)
return -1; return -1;
} }
int index_in_strings(const char *strings, const char *key) int FAST_FUNC index_in_strings(const char *strings, const char *key)
{ {
int idx = 0; int idx = 0;
@ -36,7 +36,7 @@ int index_in_strings(const char *strings, const char *key)
/* returns the array index of the string, even if it matches only a beginning */ /* returns the array index of the string, even if it matches only a beginning */
/* (index of first match is returned, or -1) */ /* (index of first match is returned, or -1) */
#ifdef UNUSED #ifdef UNUSED
int index_in_substr_array(const char *const string_array[], const char *key) int FAST_FUNC index_in_substr_array(const char *const string_array[], const char *key)
{ {
int i; int i;
int len = strlen(key); int len = strlen(key);
@ -51,7 +51,7 @@ int index_in_substr_array(const char *const string_array[], const char *key)
} }
#endif #endif
int index_in_substrings(const char *strings, const char *key) int FAST_FUNC index_in_substrings(const char *strings, const char *key)
{ {
int len = strlen(key); int len = strlen(key);
@ -68,7 +68,7 @@ int index_in_substrings(const char *strings, const char *key)
return -1; return -1;
} }
const char *nth_string(const char *strings, int n) const char* FAST_FUNC nth_string(const char *strings, int n)
{ {
while (n) { while (n) {
n--; n--;

View File

@ -16,7 +16,7 @@
#include "libbb.h" #include "libbb.h"
char *concat_path_file(const char *path, const char *filename) char* FAST_FUNC concat_path_file(const char *path, const char *filename)
{ {
char *lc; char *lc;

View File

@ -15,7 +15,7 @@
#include "libbb.h" #include "libbb.h"
char *concat_subpath_file(const char *path, const char *f) char* FAST_FUNC concat_subpath_file(const char *path, const char *f)
{ {
if (f && DOT_OR_DOTDOT(f)) if (f && DOT_OR_DOTDOT(f))
return NULL; return NULL;

View File

@ -71,7 +71,7 @@ static int ask_and_unlink(const char *dest, int flags)
* 0 copy is made or user answered "no" in interactive mode * 0 copy is made or user answered "no" in interactive mode
* (failures to preserve mode/owner/times are not reported in exit code) * (failures to preserve mode/owner/times are not reported in exit code)
*/ */
int copy_file(const char *source, const char *dest, int flags) int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
{ {
/* This is a recursive function, try to minimize stack usage */ /* This is a recursive function, try to minimize stack usage */
/* NB: each struct stat is ~100 bytes */ /* NB: each struct stat is ~100 bytes */

View File

@ -85,7 +85,7 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
#if 0 #if 0
void complain_copyfd_and_die(off_t sz) void FAST_FUNC complain_copyfd_and_die(off_t sz)
{ {
if (sz != -1) if (sz != -1)
bb_error_msg_and_die("short read"); bb_error_msg_and_die("short read");
@ -94,7 +94,7 @@ void complain_copyfd_and_die(off_t sz)
} }
#endif #endif
off_t bb_copyfd_size(int fd1, int fd2, off_t size) off_t FAST_FUNC bb_copyfd_size(int fd1, int fd2, off_t size)
{ {
if (size) { if (size) {
return bb_full_fd_action(fd1, fd2, size); return bb_full_fd_action(fd1, fd2, size);
@ -102,7 +102,7 @@ off_t bb_copyfd_size(int fd1, int fd2, off_t size)
return 0; return 0;
} }
void bb_copyfd_exact_size(int fd1, int fd2, off_t size) void FAST_FUNC bb_copyfd_exact_size(int fd1, int fd2, off_t size)
{ {
off_t sz = bb_copyfd_size(fd1, fd2, size); off_t sz = bb_copyfd_size(fd1, fd2, size);
if (sz == size) if (sz == size)
@ -113,7 +113,7 @@ void bb_copyfd_exact_size(int fd1, int fd2, off_t size)
xfunc_die(); xfunc_die();
} }
off_t bb_copyfd_eof(int fd1, int fd2) off_t FAST_FUNC bb_copyfd_eof(int fd1, int fd2)
{ {
return bb_full_fd_action(fd1, fd2, 0); return bb_full_fd_action(fd1, fd2, 0);
} }

View File

@ -36,7 +36,7 @@
* *
* NULL pw means "just fake it for login with bad username" */ * NULL pw means "just fake it for login with bad username" */
int correct_password(const struct passwd *pw) int FAST_FUNC correct_password(const struct passwd *pw)
{ {
char *unencrypted, *encrypted; char *unencrypted, *encrypted;
const char *correct; const char *correct;

View File

@ -16,7 +16,7 @@
#include "libbb.h" #include "libbb.h"
uint32_t *crc32_filltable(uint32_t *crc_table, int endian) uint32_t* FAST_FUNC crc32_filltable(uint32_t *crc_table, int endian)
{ {
uint32_t polynomial = endian ? 0x04c11db7 : 0xedb88320; uint32_t polynomial = endian ? 0x04c11db7 : 0xedb88320;
uint32_t c; uint32_t c;

View File

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
#if ENABLE_FEATURE_IPV6 #if ENABLE_FEATURE_IPV6
int create_icmp6_socket(void) int FAST_FUNC create_icmp6_socket(void)
{ {
int sock; int sock;
#if 0 #if 0

View File

@ -8,7 +8,7 @@
#include "libbb.h" #include "libbb.h"
int create_icmp_socket(void) int FAST_FUNC create_icmp_socket(void)
{ {
int sock; int sock;
#if 0 #if 0

View File

@ -24,7 +24,7 @@ static int i64c(int i)
return ('a' - 38 + i); return ('a' - 38 + i);
} }
int crypt_make_salt(char *p, int cnt, int x) int FAST_FUNC crypt_make_salt(char *p, int cnt, int x)
{ {
x += getpid() + time(NULL); x += getpid() + time(NULL);
do { do {

View File

@ -10,7 +10,7 @@
#include "libbb.h" #include "libbb.h"
/* try to open up the specified device */ /* try to open up the specified device */
int device_open(const char *device, int mode) int FAST_FUNC device_open(const char *device, int mode)
{ {
int m, f, fd; int m, f, fd;

View File

@ -16,7 +16,7 @@
* at the end of the username. * at the end of the username.
*/ */
void die_if_bad_username(const char *name) void FAST_FUNC die_if_bad_username(const char *name)
{ {
goto skip; /* 1st char being dash isn't valid */ goto skip; /* 1st char being dash isn't valid */
do { do {

View File

@ -33,7 +33,7 @@ static const char size_conv_str[] ALIGN1 =
static const char lcc[] ALIGN1 = "diouxX"; static const char lcc[] ALIGN1 = "diouxX";
int bb_dump_size(FS * fs) int FAST_FUNC bb_dump_size(FS *fs)
{ {
FU *fu; FU *fu;
int bcnt, cur_size; int bcnt, cur_size;
@ -652,7 +652,7 @@ static void display(void)
} }
} }
int bb_dump_dump(char **argv) int FAST_FUNC bb_dump_dump(char **argv)
{ {
FS *tfs; FS *tfs;
@ -674,7 +674,7 @@ int bb_dump_dump(char **argv)
return exitval; return exitval;
} }
void bb_dump_add(const char *fmt) void FAST_FUNC bb_dump_add(const char *fmt)
{ {
const char *p; const char *p;
char *p1; char *p1;

View File

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
void bb_error_msg(const char *s, ...) void FAST_FUNC bb_error_msg(const char *s, ...)
{ {
va_list p; va_list p;

View File

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
void bb_error_msg_and_die(const char *s, ...) void FAST_FUNC bb_error_msg_and_die(const char *s, ...)
{ {
va_list p; va_list p;

View File

@ -13,7 +13,7 @@
* return 1 if found; * return 1 if found;
* return 0 otherwise; * return 0 otherwise;
*/ */
int execable_file(const char *name) int FAST_FUNC execable_file(const char *name)
{ {
struct stat s; struct stat s;
return (!access(name, X_OK) && !stat(name, &s) && S_ISREG(s.st_mode)); return (!access(name, X_OK) && !stat(name, &s) && S_ISREG(s.st_mode));
@ -28,7 +28,7 @@ int execable_file(const char *name)
* return NULL otherwise; (PATHp is undefined) * return NULL otherwise; (PATHp is undefined)
* in all cases (*PATHp) contents will be trashed (s/:/NUL/). * in all cases (*PATHp) contents will be trashed (s/:/NUL/).
*/ */
char *find_execable(const char *filename, char **PATHp) char* FAST_FUNC find_execable(const char *filename, char **PATHp)
{ {
char *p, *n; char *p, *n;
@ -54,7 +54,7 @@ char *find_execable(const char *filename, char **PATHp)
* return 1 if found; * return 1 if found;
* return 0 otherwise; * return 0 otherwise;
*/ */
int exists_execable(const char *filename) int FAST_FUNC exists_execable(const char *filename)
{ {
char *path = xstrdup(getenv("PATH")); char *path = xstrdup(getenv("PATH"));
char *tmp = path; char *tmp = path;
@ -70,7 +70,7 @@ int exists_execable(const char *filename)
#if ENABLE_FEATURE_PREFER_APPLETS #if ENABLE_FEATURE_PREFER_APPLETS
/* just like the real execvp, but try to launch an applet named 'file' first /* just like the real execvp, but try to launch an applet named 'file' first
*/ */
int bb_execvp(const char *file, char *const argv[]) int FAST_FUNC bb_execvp(const char *file, char *const argv[])
{ {
return execvp(find_applet_by_name(file) >= 0 ? bb_busybox_exec_path : file, return execvp(find_applet_by_name(file) >= 0 ? bb_busybox_exec_path : file,
argv); argv);

View File

@ -14,7 +14,7 @@
#include "libbb.h" #include "libbb.h"
int fclose_if_not_stdin(FILE *f) int FAST_FUNC fclose_if_not_stdin(FILE *f)
{ {
/* Some more paranoid applets want ferror() check too */ /* Some more paranoid applets want ferror() check too */
int r = ferror(f); /* NB: does NOT set errno! */ int r = ferror(f); /* NB: does NOT set errno! */

View File

@ -13,7 +13,7 @@
#include "libbb.h" #include "libbb.h"
void fflush_stdout_and_exit(int retval) void FAST_FUNC fflush_stdout_and_exit(int retval)
{ {
if (fflush(stdout)) if (fflush(stdout))
bb_perror_msg_and_die(bb_msg_standard_output); bb_perror_msg_and_die(bb_msg_standard_output);

View File

@ -55,12 +55,12 @@ static char *xmalloc_fgets_internal(FILE *file, const char *terminating_string,
* including terminating string. * including terminating string.
* Non-terminated string can be returned if EOF is reached. * Non-terminated string can be returned if EOF is reached.
* Return NULL if EOF is reached immediately. */ * Return NULL if EOF is reached immediately. */
char *xmalloc_fgets_str(FILE *file, const char *terminating_string) char* FAST_FUNC xmalloc_fgets_str(FILE *file, const char *terminating_string)
{ {
return xmalloc_fgets_internal(file, terminating_string, 0); return xmalloc_fgets_internal(file, terminating_string, 0);
} }
char *xmalloc_fgetline_str(FILE *file, const char *terminating_string) char* FAST_FUNC xmalloc_fgetline_str(FILE *file, const char *terminating_string)
{ {
return xmalloc_fgets_internal(file, terminating_string, 1); return xmalloc_fgets_internal(file, terminating_string, 1);
} }

View File

@ -17,7 +17,7 @@
* Given any other file (or directory), find the mount table entry for its * Given any other file (or directory), find the mount table entry for its
* filesystem. * filesystem.
*/ */
struct mntent *find_mount_point(const char *name, const char *table) struct mntent* FAST_FUNC find_mount_point(const char *name, const char *table)
{ {
struct stat s; struct stat s;
dev_t mountDevice; dev_t mountDevice;

View File

@ -48,7 +48,7 @@ and therefore comm field contains "exe".
* Returns a list of all matching PIDs * Returns a list of all matching PIDs
* It is the caller's duty to free the returned pidlist. * It is the caller's duty to free the returned pidlist.
*/ */
pid_t* find_pid_by_name(const char* procName) pid_t* FAST_FUNC find_pid_by_name(const char* procName)
{ {
pid_t* pidList; pid_t* pidList;
int i = 0; int i = 0;
@ -74,7 +74,7 @@ pid_t* find_pid_by_name(const char* procName)
return pidList; return pidList;
} }
pid_t *pidlist_reverse(pid_t *pidList) pid_t* FAST_FUNC pidlist_reverse(pid_t *pidList)
{ {
int i = 0; int i = 0;
while (pidList[i]) while (pidList[i])

View File

@ -62,7 +62,7 @@ static char *find_block_device_in_dir(struct arena *ap)
return retpath; return retpath;
} }
char *find_block_device(const char *path) char* FAST_FUNC find_block_device(const char *path)
{ {
struct arena a; struct arena a;

View File

@ -14,7 +14,7 @@
* This does multiple writes as necessary. * This does multiple writes as necessary.
* Returns the amount written, or -1 on an error. * Returns the amount written, or -1 on an error.
*/ */
ssize_t full_write(int fd, const void *buf, size_t len) ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len)
{ {
ssize_t cc; ssize_t cc;
ssize_t total; ssize_t total;

View File

@ -38,7 +38,7 @@ static int open_a_console(const char *fnam)
* if someone else used X (which does a chown on /dev/console). * if someone else used X (which does a chown on /dev/console).
*/ */
int get_console_fd(void) int FAST_FUNC get_console_fd(void)
{ {
static const char *const console_names[] = { static const char *const console_names[] = {
DEV_CONSOLE, CURRENT_VC, CURRENT_TTY DEV_CONSOLE, CURRENT_VC, CURRENT_TTY
@ -75,7 +75,7 @@ enum {
VT_WAITACTIVE = 0x5607 /* wait for vt active */ VT_WAITACTIVE = 0x5607 /* wait for vt active */
}; };
void console_make_active(int fd, const int vt_num) void FAST_FUNC console_make_active(int fd, const int vt_num)
{ {
xioctl(fd, VT_ACTIVATE, (void *)(ptrdiff_t)vt_num); xioctl(fd, VT_ACTIVATE, (void *)(ptrdiff_t)vt_num);
xioctl(fd, VT_WAITACTIVE, (void *)(ptrdiff_t)vt_num); xioctl(fd, VT_WAITACTIVE, (void *)(ptrdiff_t)vt_num);

View File

@ -14,7 +14,7 @@
* "abc/def" -> "def" * "abc/def" -> "def"
* "abc/def/" -> "" * "abc/def/" -> ""
*/ */
char *bb_get_last_path_component_nostrip(const char *path) char* FAST_FUNC bb_get_last_path_component_nostrip(const char *path)
{ {
char *slash = strrchr(path, '/'); char *slash = strrchr(path, '/');
@ -30,7 +30,7 @@ char *bb_get_last_path_component_nostrip(const char *path)
* "abc/def" -> "def" * "abc/def" -> "def"
* "abc/def/" -> "def" !! * "abc/def/" -> "def" !!
*/ */
char *bb_get_last_path_component_strip(char *path) char* FAST_FUNC bb_get_last_path_component_strip(char *path)
{ {
char *slash = last_char_is(path, '/'); char *slash = last_char_is(path, '/');

View File

@ -16,7 +16,7 @@
* must be free'ed by the caller. If end is NULL '\n' isn't considered * must be free'ed by the caller. If end is NULL '\n' isn't considered
* end of line. If end isn't NULL, length of the chunk read is stored in it. * end of line. If end isn't NULL, length of the chunk read is stored in it.
* Return NULL if EOF/error */ * Return NULL if EOF/error */
char *bb_get_chunk_from_file(FILE *file, int *end) char* FAST_FUNC bb_get_chunk_from_file(FILE *file, int *end)
{ {
int ch; int ch;
int idx = 0; int idx = 0;
@ -49,7 +49,7 @@ char *bb_get_chunk_from_file(FILE *file, int *end)
} }
/* Get line, including trailing \n if any */ /* Get line, including trailing \n if any */
char *xmalloc_fgets(FILE *file) char* FAST_FUNC xmalloc_fgets(FILE *file)
{ {
int i; int i;
@ -57,7 +57,7 @@ char *xmalloc_fgets(FILE *file)
} }
/* Get line. Remove trailing \n */ /* Get line. Remove trailing \n */
char *xmalloc_fgetline(FILE *file) char* FAST_FUNC xmalloc_fgetline(FILE *file)
{ {
int i; int i;
char *c = bb_get_chunk_from_file(file, &i); char *c = bb_get_chunk_from_file(file, &i);

View File

@ -316,7 +316,7 @@ const char *applet_long_options;
uint32_t option_mask32; uint32_t option_mask32;
uint32_t uint32_t FAST_FUNC
getopt32(char **argv, const char *applet_opts, ...) getopt32(char **argv, const char *applet_opts, ...)
{ {
int argc; int argc;

View File

@ -10,7 +10,7 @@
#define DEBUG 0 #define DEBUG 0
int xgetpty(char *line) int FAST_FUNC xgetpty(char *line)
{ {
int p; int p;
#if ENABLE_FEATURE_DEVPTS #if ENABLE_FEATURE_DEVPTS

View File

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
void bb_herror_msg(const char *s, ...) void FAST_FUNC bb_herror_msg(const char *s, ...)
{ {
va_list p; va_list p;

View File

@ -9,7 +9,7 @@
#include "libbb.h" #include "libbb.h"
void bb_herror_msg_and_die(const char *s, ...) void FAST_FUNC bb_herror_msg_and_die(const char *s, ...)
{ {
va_list p; va_list p;

View File

@ -28,7 +28,7 @@
#include "libbb.h" #include "libbb.h"
const char *make_human_readable_str(unsigned long long size, const char* FAST_FUNC make_human_readable_str(unsigned long long size,
unsigned long block_size, unsigned long display_unit) unsigned long block_size, unsigned long display_unit)
{ {
/* The code will adjust for additional (appended) units */ /* The code will adjust for additional (appended) units */

View File

@ -11,7 +11,7 @@
#include "libbb.h" #include "libbb.h"
#include "inet_common.h" #include "inet_common.h"
int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
{ {
struct hostent *hp; struct hostent *hp;
#if ENABLE_FEATURE_ETC_NETWORKS #if ENABLE_FEATURE_ETC_NETWORKS
@ -81,7 +81,7 @@ int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
* & 0x4000: host instead of net, * & 0x4000: host instead of net,
* & 0x0fff: don't resolve * & 0x0fff: don't resolve
*/ */
char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) char* FAST_FUNC INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask)
{ {
/* addr-to-name cache */ /* addr-to-name cache */
struct addr { struct addr {
@ -165,7 +165,7 @@ char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask)
#if ENABLE_FEATURE_IPV6 #if ENABLE_FEATURE_IPV6
int INET6_resolve(const char *name, struct sockaddr_in6 *sin6) int FAST_FUNC INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
{ {
struct addrinfo req, *ai; struct addrinfo req, *ai;
int s; int s;
@ -189,7 +189,7 @@ int INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
#endif #endif
char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
{ {
char name[128]; char name[128];
int s; int s;

View File

@ -10,7 +10,7 @@
#include "libbb.h" #include "libbb.h"
#include <syslog.h> #include <syslog.h>
void bb_info_msg(const char *s, ...) void FAST_FUNC bb_info_msg(const char *s, ...)
{ {
va_list p; va_list p;
/* va_copy is used because it is not portable /* va_copy is used because it is not portable

View File

@ -27,7 +27,7 @@ static ino_dev_hashtable_bucket_t **ino_dev_hashtable;
* Return name if statbuf->st_ino && statbuf->st_dev are recorded in * Return name if statbuf->st_ino && statbuf->st_dev are recorded in
* ino_dev_hashtable, else return NULL * ino_dev_hashtable, else return NULL
*/ */
char *is_in_ino_dev_hashtable(const struct stat *statbuf) char* FAST_FUNC is_in_ino_dev_hashtable(const struct stat *statbuf)
{ {
ino_dev_hashtable_bucket_t *bucket; ino_dev_hashtable_bucket_t *bucket;
@ -47,7 +47,7 @@ char *is_in_ino_dev_hashtable(const struct stat *statbuf)
} }
/* Add statbuf to statbuf hash table */ /* Add statbuf to statbuf hash table */
void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name)
{ {
int i; int i;
ino_dev_hashtable_bucket_t *bucket; ino_dev_hashtable_bucket_t *bucket;
@ -69,7 +69,7 @@ void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name)
#if ENABLE_FEATURE_CLEAN_UP #if ENABLE_FEATURE_CLEAN_UP
/* Clear statbuf hash table */ /* Clear statbuf hash table */
void reset_ino_dev_hashtable(void) void FAST_FUNC reset_ino_dev_hashtable(void)
{ {
int i; int i;
ino_dev_hashtable_bucket_t *bucket; ino_dev_hashtable_bucket_t *bucket;

View File

@ -15,7 +15,7 @@
* Return TRUE if fileName is a directory. * Return TRUE if fileName is a directory.
* Nonexistent files return FALSE. * Nonexistent files return FALSE.
*/ */
int is_directory(const char *fileName, const int followLinks, struct stat *statBuf) int FAST_FUNC is_directory(const char *fileName, const int followLinks, struct stat *statBuf)
{ {
int status; int status;
struct stat astatBuf; struct stat astatBuf;

View File

@ -16,7 +16,7 @@
* *
* if (get_linux_version_code() > KERNEL_VERSION(2,2,11)) { <stuff> } * if (get_linux_version_code() > KERNEL_VERSION(2,2,11)) { <stuff> }
*/ */
int get_linux_version_code(void) int FAST_FUNC get_linux_version_code(void)
{ {
struct utsname name; struct utsname name;
char *s; char *s;

View File

@ -12,7 +12,7 @@
/* Find out if the last character of a string matches the one given. /* Find out if the last character of a string matches the one given.
* Don't underrun the buffer if the string length is 0. * Don't underrun the buffer if the string length is 0.
*/ */
char* last_char_is(const char *s, int c) char* FAST_FUNC last_char_is(const char *s, int c)
{ {
if (s && *s) { if (s && *s) {
size_t sz = strlen(s) - 1; size_t sz = strlen(s) - 1;

Some files were not shown because too many files have changed in this diff Show More