static void change_attributes(const char *name, struct globals *gp);
-static int chattr_dir_proc(const char *dir_name, struct dirent *de, void *gp)
+static int FAST_FUNC chattr_dir_proc(const char *dir_name, struct dirent *de, void *gp)
{
char *path = concat_subpath_file(dir_name, de->d_name);
/* path is NULL if de->d_name is "." or "..", else... */
/* Iterate a function on each entry of a directory */
int iterate_on_dir(const char *dir_name,
- int (*func)(const char *, struct dirent *, void *),
- void * private)
+ int FAST_FUNC (*func)(const char *, struct dirent *, void *),
+ void *private)
{
DIR *dir;
- struct dirent *de, *dep;
- int max_len, len;
-
- max_len = PATH_MAX + sizeof(struct dirent);
- de = xmalloc(max_len+1);
- memset(de, 0, max_len+1);
+ struct dirent *de;
dir = opendir(dir_name);
if (dir == NULL) {
- free(de);
return -1;
}
- while ((dep = readdir(dir))) {
- len = sizeof(struct dirent);
- if (len < dep->d_reclen)
- len = dep->d_reclen;
- if (len > max_len)
- len = max_len;
- memcpy(de, dep, len);
+ while ((de = readdir(dir)) != NULL) {
func(dir_name, de, private);
}
closedir(dir);
- free(de);
return 0;
}
/* Iterate a function on each entry of a directory */
int iterate_on_dir(const char *dir_name,
- int (*func)(const char *, struct dirent *, void *),
+ int FAST_FUNC (*func)(const char *, struct dirent *, void *),
void *private);
/* Get/set a file version on an ext2 file system */
bb_perror_msg("reading %s", name);
}
-static int lsattr_dir_proc(const char *dir_name, struct dirent *de,
- void *private UNUSED_PARAM)
+static int FAST_FUNC lsattr_dir_proc(const char *dir_name,
+ struct dirent *de,
+ void *private UNUSED_PARAM)
{
struct stat st;
char *path;
IF_FEATURE_FIND_XDEV(static dev_t *xdev_dev;)
IF_FEATURE_FIND_XDEV(static int xdev_count;)
-typedef int (*action_fp)(const char *fileName, struct stat *statbuf, void *);
+typedef int (*action_fp)(const char *fileName, struct stat *statbuf, void *) FAST_FUNC;
typedef struct {
action_fp f;
bool invert;
#endif
} action;
+
#define ACTS(name, arg...) typedef struct { action a; arg; } action_##name;
-#define ACTF(name) static int func_##name(const char *fileName UNUSED_PARAM, \
- struct stat *statbuf UNUSED_PARAM, \
- action_##name* ap UNUSED_PARAM)
- ACTS(print)
- ACTS(name, const char *pattern; bool iname;)
+#define ACTF(name) \
+ static int FAST_FUNC func_##name(const char *fileName UNUSED_PARAM, \
+ struct stat *statbuf UNUSED_PARAM, \
+ action_##name* ap UNUSED_PARAM)
+
+ ACTS(print)
+ ACTS(name, const char *pattern; bool iname;)
IF_FEATURE_FIND_PATH( ACTS(path, const char *pattern;))
IF_FEATURE_FIND_REGEX( ACTS(regex, regex_t compiled_pattern;))
IF_FEATURE_FIND_PRINT0( ACTS(print0))
#define DEVFS_PATHLEN 1024
/* Never change this otherwise the binary interface will change */
-struct devfsd_notify_struct
-{ /* Use native C types to ensure same types in kernel and user space */
+struct devfsd_notify_struct {
+ /* Use native C types to ensure same types in kernel and user space */
unsigned int type; /* DEVFSD_NOTIFY_* value */
unsigned int mode; /* Mode of the inode or device entry */
unsigned int major; /* Major number of device entry */
#define AC_RMNEWCOMPAT 10
#define AC_RESTORE 11
-struct permissions_type
-{
+struct permissions_type {
mode_t mode;
uid_t uid;
gid_t gid;
};
-struct execute_type
-{
+struct execute_type {
char *argv[MAX_ARGS + 1]; /* argv[0] must always be the programme */
};
-struct copy_type
-{
+struct copy_type {
const char *source;
const char *destination;
};
-struct action_type
-{
+struct action_type {
unsigned int what;
unsigned int when;
};
-struct config_entry_struct
-{
+struct config_entry_struct {
struct action_type action;
regex_t preg;
union
struct config_entry_struct *next;
};
-struct get_variable_info
-{
+struct get_variable_info {
const struct devfsd_notify_struct *info;
const char *devname;
char devpath[STRING_LENGTH];
/* from compat_name.c */
-struct translate_struct
-{
+struct translate_struct {
const char *match; /* The string to match to(up to length) */
const char *format; /* Format of output, "%s" takes data past match string,
NULL is effectively "%s"(just more efficient) */
struct obj_string_patch;
struct obj_symbol_patch;
-struct obj_section
-{
+struct obj_section {
ElfW(Shdr) header;
const char *name;
char *contents;
int idx;
};
-struct obj_symbol
-{
+struct obj_symbol {
struct obj_symbol *next; /* hash table link */
const char *name;
unsigned long value;
struct obj_section **load_order_search_start;
struct obj_string_patch *string_patches;
struct obj_symbol_patch *symbol_patches;
- int (*symbol_cmp)(const char *, const char *);
- unsigned long (*symbol_hash)(const char *);
+ int (*symbol_cmp)(const char *, const char *); /* cant be FAST_FUNC */
+ unsigned long (*symbol_hash)(const char *) FAST_FUNC;
unsigned long local_symtab_size;
struct obj_symbol **local_symtab;
struct obj_symbol *symtab[HASH_BUCKETS];
/* Generic object manipulation routines. */
-static unsigned long obj_elf_hash(const char *);
+static unsigned long FAST_FUNC obj_elf_hash(const char *);
static unsigned long obj_elf_hash_n(const char *, unsigned long len);
static struct obj_symbol *obj_find_symbol(struct obj_file *f,
- const char *name);
+ const char *name);
static ElfW(Addr) obj_symbol_final_value(struct obj_file *f,
- struct obj_symbol *sym);
+ struct obj_symbol *sym);
#if ENABLE_FEATURE_INSMOD_VERSION_CHECKING
static void obj_set_symbol_compare(struct obj_file *f,
- int (*cmp)(const char *, const char *),
- unsigned long (*hash)(const char *));
+ int (*cmp)(const char *, const char *),
+ unsigned long (*hash)(const char *) FAST_FUNC);
#endif
static struct obj_section *obj_find_section(struct obj_file *f,
- const char *name);
+ const char *name);
static void obj_insert_section_load_order(struct obj_file *f,
- struct obj_section *sec);
+ struct obj_section *sec);
static struct obj_section *obj_create_alloced_section(struct obj_file *f,
- const char *name,
- unsigned long align,
- unsigned long size);
+ const char *name,
+ unsigned long align,
+ unsigned long size);
static struct obj_section *obj_create_alloced_section_first(struct obj_file *f,
- const char *name,
- unsigned long align,
- unsigned long size);
+ const char *name,
+ unsigned long align,
+ unsigned long size);
static void *obj_extend_section(struct obj_section *sec, unsigned long more);
static void obj_string_patch(struct obj_file *f, int secidx, ElfW(Addr) offset,
- const char *string);
+ const char *string);
static void obj_symbol_patch(struct obj_file *f, int secidx, ElfW(Addr) offset,
- struct obj_symbol *sym);
+ struct obj_symbol *sym);
static void obj_check_undefineds(struct obj_file *f);
static struct obj_symbol *arch_new_symbol(void);
static enum obj_reloc arch_apply_relocation(struct obj_file *f,
- struct obj_section *targsec,
- /*struct obj_section *symsec,*/
- struct obj_symbol *sym,
- ElfW(RelM) *rel, ElfW(Addr) value);
+ struct obj_section *targsec,
+ /*struct obj_section *symsec,*/
+ struct obj_symbol *sym,
+ ElfW(RelM) *rel, ElfW(Addr) value);
static void arch_create_got(struct obj_file *f);
#if ENABLE_FEATURE_CHECK_TAINTED_MODULE
#if defined(USE_LIST)
-struct arch_list_entry
-{
+struct arch_list_entry {
struct arch_list_entry *next;
LIST_ARCHTYPE addend;
int offset;
#if defined(USE_SINGLE)
-struct arch_single_entry
-{
+struct arch_single_entry {
int offset;
int inited : 1;
int allocated : 1;
#endif
#if defined(__mips__)
-struct mips_hi16
-{
+struct mips_hi16 {
struct mips_hi16 *next;
ElfW(Addr) *addr;
ElfW(Addr) value;
static enum obj_reloc
arch_apply_relocation(struct obj_file *f,
- struct obj_section *targsec,
- /*struct obj_section *symsec,*/
- struct obj_symbol *sym,
- ElfW(RelM) *rel, ElfW(Addr) v)
+ struct obj_section *targsec,
+ /*struct obj_section *symsec,*/
+ struct obj_symbol *sym,
+ ElfW(RelM) *rel, ElfW(Addr) v)
{
#if defined(__arm__) || defined(__i386__) || defined(__mc68000__) \
|| defined(__sh__) || defined(__s390__) || defined(__x86_64__) \
#if defined(USE_SINGLE)
static int arch_single_init(/*ElfW(RelM) *rel,*/ struct arch_single_entry *single,
- int offset, int size)
+ int offset, int size)
{
if (single->allocated == 0) {
single->allocated = 1;
#if defined(USE_GOT_ENTRIES) || defined(USE_PLT_ENTRIES)
static struct obj_section *arch_xsect_init(struct obj_file *f, const char *name,
- int offset, int size)
+ int offset, int size)
{
struct obj_section *myrelsec = obj_find_section(f, name);
return h;
}
-static unsigned long obj_elf_hash(const char *name)
+static unsigned long FAST_FUNC obj_elf_hash(const char *name)
{
return obj_elf_hash_n(name, strlen(name));
}
/* String hashing for non-co-versioned kernel and module. Here
we are simply forced to drop the crc from the hash. */
-static unsigned long ncv_symbol_hash(const char *str)
+static unsigned long FAST_FUNC ncv_symbol_hash(const char *str)
{
size_t len = strlen(str);
if (len > 10 && str[len - 10] == '_' && str[len - 9] == 'R')
static void
obj_set_symbol_compare(struct obj_file *f,
- int (*cmp) (const char *, const char *),
- unsigned long (*hash) (const char *))
+ int (*cmp) (const char *, const char *),
+ unsigned long (*hash) (const char *) FAST_FUNC)
{
if (cmp)
f->symbol_cmp = cmp;
memcpy(tmptab, f->symtab, sizeof(tmptab));
memset(f->symtab, 0, sizeof(f->symtab));
- for (i = 0; i < HASH_BUCKETS; ++i)
+ for (i = 0; i < HASH_BUCKETS; ++i) {
for (sym = tmptab[i]; sym; sym = next) {
unsigned long h = hash(sym->name) % HASH_BUCKETS;
next = sym->next;
sym->next = f->symtab[h];
f->symtab[h] = sym;
}
+ }
}
}
static struct obj_symbol *
obj_add_symbol(struct obj_file *f, const char *name,
- unsigned long symidx, int info,
- int secidx, ElfW(Addr) value,
- unsigned long size)
+ unsigned long symidx, int info,
+ int secidx, ElfW(Addr) value,
+ unsigned long size)
{
struct obj_symbol *sym;
unsigned long hash = f->symbol_hash(name) % HASH_BUCKETS;
}
static struct obj_section *helper_create_alloced_section(struct obj_file *f,
- const char *name,
- unsigned long align,
- unsigned long size)
+ const char *name,
+ unsigned long align,
+ unsigned long size)
{
int newidx = f->header.e_shnum++;
struct obj_section *sec;
}
static struct obj_section *obj_create_alloced_section(struct obj_file *f,
- const char *name,
- unsigned long align,
- unsigned long size)
+ const char *name,
+ unsigned long align,
+ unsigned long size)
{
struct obj_section *sec;
}
static struct obj_section *obj_create_alloced_section_first(struct obj_file *f,
- const char *name,
- unsigned long align,
- unsigned long size)
+ const char *name,
+ unsigned long align,
+ unsigned long size)
{
struct obj_section *sec;
new module. */
static int add_symbols_from(struct obj_file *f,
- int idx,
- struct new_module_symbol *syms,
- size_t nsyms)
+ int idx,
+ struct new_module_symbol *syms,
+ size_t nsyms)
{
struct new_module_symbol *s;
size_t i;
static void
obj_symbol_patch(struct obj_file *f, int secidx, ElfW(Addr) offset,
- struct obj_symbol *sym)
+ struct obj_symbol *sym)
{
struct obj_symbol_patch *p;
#define TAINT_URL "http://www.tux.org/lkml/#export-tainted"
static void set_tainted(int fd, const char *m_name,
- int kernel_has_tainted, int taint, const char *text1, const char *text2)
+ int kernel_has_tainted, int taint,
+ const char *text1, const char *text2)
{
static smallint printed_info;
*/
static void
add_ksymoops_symbols(struct obj_file *f, const char *filename,
- const char *m_name)
+ const char *m_name)
{
static const char symprefix[] ALIGN1 = "__insmod_";
static const char section_names[][8] = {
struct method_t {
const char *name;
- int (*up)(struct interface_defn_t *ifd, execfn *e);
- int (*down)(struct interface_defn_t *ifd, execfn *e);
+ int (*up)(struct interface_defn_t *ifd, execfn *e) FAST_FUNC;
+ int (*down)(struct interface_defn_t *ifd, execfn *e) FAST_FUNC;
};
struct address_family_t {
#endif
#if ENABLE_FEATURE_IFUPDOWN_IPV6
-static int loopback_up6(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC loopback_up6(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
int result;
#endif
}
-static int loopback_down6(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC loopback_down6(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
return execute("ip link set %iface% down", ifd, exec);
#endif
}
-static int static_up6(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec)
{
int result;
#if ENABLE_FEATURE_IFUPDOWN_IP
return ((result == 3) ? 3 : 0);
}
-static int static_down6(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC static_down6(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
return execute("ip link set %iface% down", ifd, exec);
}
#if ENABLE_FEATURE_IFUPDOWN_IP
-static int v4tunnel_up(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC v4tunnel_up(struct interface_defn_t *ifd, execfn *exec)
{
int result;
result = execute("ip tunnel add %iface% mode sit remote "
return ((result == 4) ? 4 : 0);
}
-static int v4tunnel_down(struct interface_defn_t * ifd, execfn * exec)
+static int FAST_FUNC v4tunnel_down(struct interface_defn_t * ifd, execfn * exec)
{
return execute("ip tunnel del %iface%", ifd, exec);
}
#endif /* FEATURE_IFUPDOWN_IPV6 */
#if ENABLE_FEATURE_IFUPDOWN_IPV4
-static int loopback_up(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC loopback_up(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
int result;
#endif
}
-static int loopback_down(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC loopback_down(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
int result;
#endif
}
-static int static_up(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec)
{
int result;
#if ENABLE_FEATURE_IFUPDOWN_IP
#endif
}
-static int static_down(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC static_down(struct interface_defn_t *ifd, execfn *exec)
{
int result;
#if ENABLE_FEATURE_IFUPDOWN_IP
}
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
-struct dhcp_client_t
-{
+struct dhcp_client_t {
const char *name;
const char *startcmd;
const char *stopcmd;
#endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
-static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
unsigned i;
#if ENABLE_FEATURE_IFUPDOWN_IP
return 0;
}
#elif ENABLE_APP_UDHCPC
-static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
/* ip doesn't up iface when it configures it (unlike ifconfig) */
ifd, exec);
}
#else
-static int dhcp_up(struct interface_defn_t *ifd UNUSED_PARAM,
+static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd UNUSED_PARAM,
execfn *exec UNUSED_PARAM)
{
return 0; /* no dhcp support */
#endif
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
-static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
int result = 0;
unsigned i;
return ((result == 3) ? 3 : 0);
}
#elif ENABLE_APP_UDHCPC
-static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
int result;
result = execute("kill "
return ((result == 3) ? 3 : 0);
}
#else
-static int dhcp_down(struct interface_defn_t *ifd UNUSED_PARAM,
+static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd UNUSED_PARAM,
execfn *exec UNUSED_PARAM)
{
return 0; /* no dhcp support */
}
#endif
-static int manual_up_down(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM)
+static int FAST_FUNC manual_up_down(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM)
{
return 1;
}
-static int bootp_up(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC bootp_up(struct interface_defn_t *ifd, execfn *exec)
{
return execute("bootpc[[ --bootfile %bootfile%]] --dev %iface%"
"[[ --server %server%]][[ --hwaddr %hwaddr%]]"
" --returniffail --serverbcast", ifd, exec);
}
-static int ppp_up(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC ppp_up(struct interface_defn_t *ifd, execfn *exec)
{
return execute("pon[[ %provider%]]", ifd, exec);
}
-static int ppp_down(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC ppp_down(struct interface_defn_t *ifd, execfn *exec)
{
return execute("poff[[ %provider%]]", ifd, exec);
}
-static int wvdial_up(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC wvdial_up(struct interface_defn_t *ifd, execfn *exec)
{
return execute("start-stop-daemon --start -x wvdial "
"-p /var/run/wvdial.%iface% -b -m --[[ %provider%]]", ifd, exec);
}
-static int wvdial_down(struct interface_defn_t *ifd, execfn *exec)
+static int FAST_FUNC wvdial_down(struct interface_defn_t *ifd, execfn *exec)
{
return execute("start-stop-daemon --stop -x wvdial "
"-p /var/run/wvdial.%iface% -s 2", ifd, exec);
#ifdef INETD_BUILTINS_ENABLED
/* Echo received data */
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
-static void echo_stream(int, servtab_t *);
-static void echo_dg(int, servtab_t *);
+static void FAST_FUNC echo_stream(int, servtab_t *);
+static void FAST_FUNC echo_dg(int, servtab_t *);
#endif
/* Internet /dev/null */
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD
-static void discard_stream(int, servtab_t *);
-static void discard_dg(int, servtab_t *);
+static void FAST_FUNC discard_stream(int, servtab_t *);
+static void FAST_FUNC discard_dg(int, servtab_t *);
#endif
/* Return 32 bit time since 1900 */
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_TIME
-static void machtime_stream(int, servtab_t *);
-static void machtime_dg(int, servtab_t *);
+static void FAST_FUNC machtime_stream(int, servtab_t *);
+static void FAST_FUNC machtime_dg(int, servtab_t *);
#endif
/* Return human-readable time */
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME
-static void daytime_stream(int, servtab_t *);
-static void daytime_dg(int, servtab_t *);
+static void FAST_FUNC daytime_stream(int, servtab_t *);
+static void FAST_FUNC daytime_dg(int, servtab_t *);
#endif
/* Familiar character generator */
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
-static void chargen_stream(int, servtab_t *);
-static void chargen_dg(int, servtab_t *);
+static void FAST_FUNC chargen_stream(int, servtab_t *);
+static void FAST_FUNC chargen_dg(int, servtab_t *);
#endif
struct builtin {
/* NB: not necessarily NUL terminated */
char bi_service7[7]; /* internally provided service name */
uint8_t bi_fork; /* 1 if stream fn should run in child */
- void (*bi_stream_fn)(int, servtab_t *);
- void (*bi_dgram_fn)(int, servtab_t *);
+ void (*bi_stream_fn)(int, servtab_t *) FAST_FUNC;
+ void (*bi_dgram_fn)(int, servtab_t *) FAST_FUNC;
};
static const struct builtin builtins[] = {
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
/* Echo service -- echo data back. */
/* ARGSUSED */
-static void echo_stream(int s, servtab_t *sep UNUSED_PARAM)
+static void FAST_FUNC echo_stream(int s, servtab_t *sep UNUSED_PARAM)
{
#if BB_MMU
while (1) {
/* on failure we return to main, which does exit(EXIT_FAILURE) */
#endif
}
-static void echo_dg(int s, servtab_t *sep)
+static void FAST_FUNC echo_dg(int s, servtab_t *sep)
{
enum { BUFSIZE = 12*1024 }; /* for jumbo sized packets! :) */
char *buf = xmalloc(BUFSIZE); /* too big for stack */
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD
/* Discard service -- ignore data. */
/* ARGSUSED */
-static void discard_stream(int s, servtab_t *sep UNUSED_PARAM)
+static void FAST_FUNC discard_stream(int s, servtab_t *sep UNUSED_PARAM)
{
#if BB_MMU
while (safe_read(s, line, LINE_SIZE) > 0)
#endif
}
/* ARGSUSED */
-static void discard_dg(int s, servtab_t *sep UNUSED_PARAM)
+static void FAST_FUNC discard_dg(int s, servtab_t *sep UNUSED_PARAM)
{
/* dgram builtins are non-forking - DONT BLOCK! */
recv(s, line, LINE_SIZE, MSG_DONTWAIT);
}
/* Character generator. MMU arches only. */
/* ARGSUSED */
-static void chargen_stream(int s, servtab_t *sep UNUSED_PARAM)
+static void FAST_FUNC chargen_stream(int s, servtab_t *sep UNUSED_PARAM)
{
char *rs;
int len;
}
}
/* ARGSUSED */
-static void chargen_dg(int s, servtab_t *sep)
+static void FAST_FUNC chargen_dg(int s, servtab_t *sep)
{
int len;
char text[LINESIZ + 2];
return htonl((uint32_t)(tv.tv_sec + 2208988800));
}
/* ARGSUSED */
-static void machtime_stream(int s, servtab_t *sep UNUSED_PARAM)
+static void FAST_FUNC machtime_stream(int s, servtab_t *sep UNUSED_PARAM)
{
uint32_t result;
result = machtime();
full_write(s, &result, sizeof(result));
}
-static void machtime_dg(int s, servtab_t *sep)
+static void FAST_FUNC machtime_dg(int s, servtab_t *sep)
{
uint32_t result;
len_and_sockaddr *lsa = alloca(LSA_LEN_SIZE + sep->se_lsa->len);
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME
/* Return human-readable time of day */
/* ARGSUSED */
-static void daytime_stream(int s, servtab_t *sep UNUSED_PARAM)
+static void FAST_FUNC daytime_stream(int s, servtab_t *sep UNUSED_PARAM)
{
time_t t;
t = time(NULL);
fdprintf(s, "%.24s\r\n", ctime(&t));
}
-static void daytime_dg(int s, servtab_t *sep)
+static void FAST_FUNC daytime_dg(int s, servtab_t *sep)
{
time_t t;
len_and_sockaddr *lsa = alloca(LSA_LEN_SIZE + sep->se_lsa->len);
return 0;
}
-static int print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM,
+static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM,
struct nlmsghdr *n, void *arg UNUSED_PARAM)
{
struct ifaddrmsg *ifa = NLMSG_DATA(n);
}
-struct nlmsg_list
-{
+struct nlmsg_list {
struct nlmsg_list *next;
struct nlmsghdr h;
};
}
-static int store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+static int FAST_FUNC store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
{
struct nlmsg_list **linfo = (struct nlmsg_list**)arg;
struct nlmsg_list *h;
return hz_internal;
}
-static int print_route(const struct sockaddr_nl *who UNUSED_PARAM,
+static int FAST_FUNC print_route(const struct sockaddr_nl *who UNUSED_PARAM,
struct nlmsghdr *n, void *arg UNUSED_PARAM)
{
struct rtmsg *r = NLMSG_DATA(n);
}
*/
-static int print_rule(const struct sockaddr_nl *who UNUSED_PARAM,
+static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM,
struct nlmsghdr *n, void *arg UNUSED_PARAM)
{
struct rtmsg *r = NLMSG_DATA(n);
}
static int rtnl_dump_filter(struct rtnl_handle *rth,
- int (*filter)(const struct sockaddr_nl *, struct nlmsghdr *n, void *),
+ int (*filter)(const struct sockaddr_nl *, struct nlmsghdr *n, void *) FAST_FUNC,
void *arg1/*,
int (*junk)(struct sockaddr_nl *, struct nlmsghdr *n, void *),
void *arg2*/)
}
int FAST_FUNC xrtnl_dump_filter(struct rtnl_handle *rth,
- int (*filter)(const struct sockaddr_nl *, struct nlmsghdr *, void *),
+ int (*filter)(const struct sockaddr_nl *, struct nlmsghdr *, void *) FAST_FUNC,
void *arg1)
{
int ret = rtnl_dump_filter(rth, filter, arg1/*, NULL, NULL*/);
}
int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
- pid_t peer, unsigned groups,
- struct nlmsghdr *answer,
- int (*junk)(struct sockaddr_nl *, struct nlmsghdr *, void *),
- void *jarg)
+ pid_t peer, unsigned groups,
+ struct nlmsghdr *answer,
+ int (*junk)(struct sockaddr_nl *, struct nlmsghdr *, void *),
+ void *jarg)
{
/* bbox doesn't use parameters no. 3, 4, 6, 7, they are stubbed out */
#define peer 0
extern int xrtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type) FAST_FUNC;
extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len) FAST_FUNC;
extern int xrtnl_dump_filter(struct rtnl_handle *rth,
- int (*filter)(const struct sockaddr_nl*, struct nlmsghdr *n, void*),
- void *arg1) FAST_FUNC;
+ int (*filter)(const struct sockaddr_nl*, struct nlmsghdr *n, void*) FAST_FUNC,
+ void *arg1) FAST_FUNC;
/* bbox doesn't use parameters no. 3, 4, 6, 7, stub them out */
#define rtnl_talk(rtnl, n, peer, groups, answer, junk, jarg) \
rtnl_talk(rtnl, n, answer)
extern int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
- unsigned groups, struct nlmsghdr *answer,
- int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
- void *jarg) FAST_FUNC;
+ unsigned groups, struct nlmsghdr *answer,
+ int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
+ void *jarg) FAST_FUNC;
extern int rtnl_send(struct rtnl_handle *rth, char *buf, int) FAST_FUNC;
return NULL;
}
-int ll_remember_index(const struct sockaddr_nl *who UNUSED_PARAM,
+int FAST_FUNC ll_remember_index(const struct sockaddr_nl *who UNUSED_PARAM,
struct nlmsghdr *n,
void *arg UNUSED_PARAM)
{
return 0;
}
-const char *ll_idx_n2a(int idx, char *buf)
+const char FAST_FUNC *ll_idx_n2a(int idx, char *buf)
{
struct idxmap *im;
}
-const char *ll_index_to_name(int idx)
+const char FAST_FUNC *ll_index_to_name(int idx)
{
static char nbuf[16];
}
#endif
-unsigned ll_index_to_flags(int idx)
+unsigned FAST_FUNC ll_index_to_flags(int idx)
{
struct idxmap *im;
return 0;
}
-int xll_name_to_index(const char *name)
+int FAST_FUNC xll_name_to_index(const char *name)
{
int ret = 0;
int sock_fd;
return ret;
}
-int ll_init_map(struct rtnl_handle *rth)
+int FAST_FUNC ll_init_map(struct rtnl_handle *rth)
{
xrtnl_wilddump_request(rth, AF_UNSPEC, RTM_GETLINK);
xrtnl_dump_filter(rth, ll_remember_index, &idxmap);
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
-int ll_remember_index(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
-int ll_init_map(struct rtnl_handle *rth);
-int xll_name_to_index(const char *name);
-const char *ll_index_to_name(int idx);
-const char *ll_idx_n2a(int idx, char *buf);
+int ll_remember_index(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) FAST_FUNC;
+int ll_init_map(struct rtnl_handle *rth) FAST_FUNC;
+int xll_name_to_index(const char *name) FAST_FUNC;
+const char *ll_index_to_name(int idx) FAST_FUNC;
+const char *ll_idx_n2a(int idx, char *buf) FAST_FUNC;
/* int ll_index_to_type(int idx); */
-unsigned ll_index_to_flags(int idx);
+unsigned ll_index_to_flags(int idx) FAST_FUNC;
POP_SAVED_FUNCTION_VISIBILITY
/* on these functions, make sure your datatype matches */
-static int read_ip(const char *line, void *arg)
+static int FAST_FUNC read_ip(const char *line, void *arg)
{
len_and_sockaddr *lsa;
}
-static int read_mac(const char *line, void *arg)
+static int FAST_FUNC read_mac(const char *line, void *arg)
{
return NULL == ether_aton_r(line, (struct ether_addr *)arg);
}
-static int read_str(const char *line, void *arg)
+static int FAST_FUNC read_str(const char *line, void *arg)
{
char **dest = arg;
}
-static int read_u32(const char *line, void *arg)
+static int FAST_FUNC read_u32(const char *line, void *arg)
{
*(uint32_t*)arg = bb_strtou32(line, NULL, 10);
return errno == 0;
}
-static int read_yn(const char *line, void *arg)
+static int FAST_FUNC read_yn(const char *line, void *arg)
{
char *dest = arg;
/* read a dhcp option and add it to opt_list */
-static int read_opt(const char *const_line, void *arg)
+static int FAST_FUNC read_opt(const char *const_line, void *arg)
{
struct option_set **opt_list = arg;
char *opt, *val, *endptr;
return retval;
}
-static int read_staticlease(const char *const_line, void *arg)
+static int FAST_FUNC read_staticlease(const char *const_line, void *arg)
{
char *line;
char *mac_string;
struct config_keyword {
const char *keyword;
- int (*handler)(const char *line, void *var);
+ int (*handler)(const char *line, void *var) FAST_FUNC;
void *var;
const char *def;
};
#define S_STAT(a) \
typedef struct a { \
struct s_stat *next; \
- void (*collect)(struct a *s); \
+ void (*collect)(struct a *s) FAST_FUNC; \
const char *label;
#define S_STAT_END(a) } a;
S_STAT(s_stat)
S_STAT_END(s_stat)
-static void collect_literal(s_stat *s UNUSED_PARAM)
+static void FAST_FUNC collect_literal(s_stat *s UNUSED_PARAM)
{
}
S_STAT_END(cpu_stat)
-static void collect_cpu(cpu_stat *s)
+static void FAST_FUNC collect_cpu(cpu_stat *s)
{
ullong data[CPU_FIELDCNT] = { 0, 0, 0, 0, 0, 0, 0 };
unsigned frac[CPU_FIELDCNT] = { 0, 0, 0, 0, 0, 0, 0 };
int no;
S_STAT_END(int_stat)
-static void collect_int(int_stat *s)
+static void FAST_FUNC collect_int(int_stat *s)
{
ullong data[1];
ullong old;
ullong old;
S_STAT_END(ctx_stat)
-static void collect_ctx(ctx_stat *s)
+static void FAST_FUNC collect_ctx(ctx_stat *s)
{
ullong data[1];
ullong old;
ullong old[2];
S_STAT_END(blk_stat)
-static void collect_blk(blk_stat *s)
+static void FAST_FUNC collect_blk(blk_stat *s)
{
ullong data[2];
int i;
ullong old;
S_STAT_END(fork_stat)
-static void collect_thread_nr(fork_stat *s UNUSED_PARAM)
+static void FAST_FUNC collect_thread_nr(fork_stat *s UNUSED_PARAM)
{
ullong data[1];
scale(data[0]);
}
-static void collect_fork(fork_stat *s)
+static void FAST_FUNC collect_fork(fork_stat *s)
{
ullong data[1];
ullong old;
char *device_colon;
S_STAT_END(if_stat)
-static void collect_if(if_stat *s)
+static void FAST_FUNC collect_if(if_stat *s)
{
ullong data[4];
int i;
//HugePages_Total: 0
//HugePages_Free: 0
//Hugepagesize: 4096 kB
-static void collect_mem(mem_stat *s)
+static void FAST_FUNC collect_mem(mem_stat *s)
{
ullong m_total = 0;
ullong m_free = 0;
S_STAT(swp_stat)
S_STAT_END(swp_stat)
-static void collect_swp(swp_stat *s UNUSED_PARAM)
+static void FAST_FUNC collect_swp(swp_stat *s UNUSED_PARAM)
{
ullong s_total[1];
ullong s_free[1];
S_STAT(fd_stat)
S_STAT_END(fd_stat)
-static void collect_fd(fd_stat *s UNUSED_PARAM)
+static void FAST_FUNC collect_fd(fd_stat *s UNUSED_PARAM)
{
ullong data[2];
int scale;
S_STAT_END(time_stat)
-static void collect_time(time_stat *s)
+static void FAST_FUNC collect_time(time_stat *s)
{
char buf[sizeof("12:34:56.123456")];
struct tm* tm;
return (s_stat*)s;
}
-static void collect_info(s_stat *s)
+static void FAST_FUNC collect_info(s_stat *s)
{
gen ^= 1;
while (s) {
}
}
-static void
+static void FAST_FUNC
shcmd(union node *cmd, FILE *fp)
{
union node *np;
}
#if ENABLE_ASH_GETOPTS
-static void getoptsreset(const char *value);
+static void FAST_FUNC getoptsreset(const char *value);
#endif
struct var {
struct var *next; /* next entry in hash list */
int flags; /* flags are defined above */
const char *text; /* name=value */
- void (*func)(const char *); /* function to be called when */
+ void (*func)(const char *) FAST_FUNC; /* function to be called when */
/* the variable gets set/unset */
};
#endif
#if ENABLE_ASH_MAIL
static void chkmail(void);
-static void changemail(const char *);
+static void changemail(const char *) FAST_FUNC;
#endif
-static void changepath(const char *);
+static void changepath(const char *) FAST_FUNC;
#if ENABLE_ASH_RANDOM_SUPPORT
-static void change_random(const char *);
+static void change_random(const char *) FAST_FUNC;
#endif
static const struct {
int flags;
const char *text;
- void (*func)(const char *);
+ void (*func)(const char *) FAST_FUNC;
} varinit_data[] = {
#ifdef IFS_BROKEN
{ VSTRFIXED|VTEXTFIXED , defifsvar , NULL },
#define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c)))
#if ENABLE_ASH_GETOPTS
-static void
+static void FAST_FUNC
getoptsreset(const char *value)
{
shellparam.optind = number(value);
return err;
}
-static int
+static int FAST_FUNC
cdcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
const char *dest;
return 0;
}
-static int
+static int FAST_FUNC
pwdcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
int flags;
/*
* TODO - sort output
*/
-static int
+static int FAST_FUNC
aliascmd(int argc UNUSED_PARAM, char **argv)
{
char *n, *v;
return ret;
}
-static int
+static int FAST_FUNC
unaliascmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
int i;
doing_jobctl = on;
}
-static int
+static int FAST_FUNC
killcmd(int argc, char **argv)
{
int i = 1;
return status;
}
-static int
+static int FAST_FUNC
fg_bgcmd(int argc UNUSED_PARAM, char **argv)
{
struct job *jp;
}
}
-static int
+static int FAST_FUNC
jobscmd(int argc UNUSED_PARAM, char **argv)
{
int mode, m;
return retval;
}
-static int
+static int FAST_FUNC
waitcmd(int argc UNUSED_PARAM, char **argv)
{
struct job *job;
/* These forward decls are needed to use "eval" code for backticks handling: */
static uint8_t back_exitstatus; /* exit status of backquoted command */
#define EV_EXIT 01 /* exit after evaluating tree */
-static void evaltree(union node *, int);
+static void FAST_FUNC evaltree(union node *, int);
-static void
+static void FAST_FUNC
evalbackcmd(union node *n, struct backcmd *result)
{
int saveherefd;
struct builtincmd {
const char *name;
- int (*builtin)(int, char **);
+ int (*builtin)(int, char **) FAST_FUNC;
/* unsigned flags; */
};
#define IS_BUILTIN_SPECIAL(b) ((b)->name[0] & 1)
cmdp->rehash = 0;
}
-static int
+static int FAST_FUNC
hashcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
struct tblentry **pp;
* pathval() still returns the old value at this point.
* Called with interrupts off.
*/
-static void
+static void FAST_FUNC
changepath(const char *new)
{
const char *old;
return 0;
}
-static int
+static int FAST_FUNC
typecmd(int argc UNUSED_PARAM, char **argv)
{
int i = 1;
}
#if ENABLE_ASH_CMDCMD
-static int
+static int FAST_FUNC
commandcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
int c;
}
/* forward declarations - evaluation is fairly recursive business... */
-static void evalloop(union node *, int);
-static void evalfor(union node *, int);
-static void evalcase(union node *, int);
-static void evalsubshell(union node *, int);
+static void FAST_FUNC evalloop(union node *, int);
+static void FAST_FUNC evalfor(union node *, int);
+static void FAST_FUNC evalcase(union node *, int);
+static void FAST_FUNC evalsubshell(union node *, int);
static void expredir(union node *);
-static void evalpipe(union node *, int);
-static void evalcommand(union node *, int);
+static void FAST_FUNC evalpipe(union node *, int);
+static void FAST_FUNC evalcommand(union node *, int);
static int evalbltin(const struct builtincmd *, int, char **);
static void prehash(union node *);
* Evaluate a parse tree. The value is left in the global variable
* exitstatus.
*/
-static void
+static void FAST_FUNC
evaltree(union node *n, int flags)
{
struct jmploc *volatile savehandler = exception_handler;
struct jmploc jmploc;
int checkexit = 0;
- void (*evalfn)(union node *, int);
+ void (*evalfn)(union node *, int) FAST_FUNC;
int status;
int int_level;
#endif
void evaltreenr(union node *, int) __attribute__ ((alias("evaltree"),__noreturn__));
-static void
+static void FAST_FUNC
evalloop(union node *n, int flags)
{
int status;
exitstatus = status;
}
-static void
+static void FAST_FUNC
evalfor(union node *n, int flags)
{
struct arglist arglist;
popstackmark(&smark);
}
-static void
+static void FAST_FUNC
evalcase(union node *n, int flags)
{
union node *cp;
/*
* Kick off a subshell to evaluate a tree.
*/
-static void
+static void FAST_FUNC
evalsubshell(union node *n, int flags)
{
struct job *jp;
* of the shell, which make the last process in a pipeline the parent
* of all the rest.)
*/
-static void
+static void FAST_FUNC
evalpipe(union node *n, int flags)
{
struct job *jp;
/*
* The "local" command.
*/
-static int
+static int FAST_FUNC
localcmd(int argc UNUSED_PARAM, char **argv)
{
char *name;
return 0;
}
-static int
+static int FAST_FUNC
falsecmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
return 1;
}
-static int
+static int FAST_FUNC
truecmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
return 0;
}
-static int
+static int FAST_FUNC
execcmd(int argc UNUSED_PARAM, char **argv)
{
if (argv[1]) {
/*
* The return command.
*/
-static int
+static int FAST_FUNC
returncmd(int argc UNUSED_PARAM, char **argv)
{
/*
}
/* Forward declarations for builtintab[] */
-static int breakcmd(int, char **);
-static int dotcmd(int, char **);
-static int evalcmd(int, char **);
-static int exitcmd(int, char **);
-static int exportcmd(int, char **);
+static int breakcmd(int, char **) FAST_FUNC;
+static int dotcmd(int, char **) FAST_FUNC;
+static int evalcmd(int, char **) FAST_FUNC;
+static int exitcmd(int, char **) FAST_FUNC;
+static int exportcmd(int, char **) FAST_FUNC;
#if ENABLE_ASH_GETOPTS
-static int getoptscmd(int, char **);
+static int getoptscmd(int, char **) FAST_FUNC;
#endif
#if !ENABLE_FEATURE_SH_EXTRA_QUIET
-static int helpcmd(int, char **);
+static int helpcmd(int, char **) FAST_FUNC;
#endif
#if ENABLE_SH_MATH_SUPPORT
-static int letcmd(int, char **);
+static int letcmd(int, char **) FAST_FUNC;
#endif
-static int readcmd(int, char **);
-static int setcmd(int, char **);
-static int shiftcmd(int, char **);
-static int timescmd(int, char **);
-static int trapcmd(int, char **);
-static int umaskcmd(int, char **);
-static int unsetcmd(int, char **);
-static int ulimitcmd(int, char **);
+static int readcmd(int, char **) FAST_FUNC;
+static int setcmd(int, char **) FAST_FUNC;
+static int shiftcmd(int, char **) FAST_FUNC;
+static int timescmd(int, char **) FAST_FUNC;
+static int trapcmd(int, char **) FAST_FUNC;
+static int umaskcmd(int, char **) FAST_FUNC;
+static int unsetcmd(int, char **) FAST_FUNC;
+static int ulimitcmd(int, char **) FAST_FUNC;
#define BUILTIN_NOSPEC "0"
#define BUILTIN_SPECIAL "1"
* Apart from the above, [[ expr ]] should work as [ expr ]
*/
-#define echocmd echo_main
-#define printfcmd printf_main
-#define testcmd test_main
+/* Stubs for calling non-FAST_FUNC's */
+static int FAST_FUNC echocmd(int argc, char **argv) { return echo_main(argc, argv); }
+static int FAST_FUNC printfcmd(int argc, char **argv) { return printf_main(argc, argv); }
+static int FAST_FUNC testcmd(int argc, char **argv) { return test_main(argc, argv); }
/* Keep these in proper order since it is searched via bsearch() */
static const struct builtincmd builtintab[] = {
return 0;
return *q == '=';
}
-static int
+static int FAST_FUNC
bltincmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
/* Preserve exitstatus of a previous possible redirection
* as POSIX mandates */
return back_exitstatus;
}
-static void
+static void FAST_FUNC
evalcommand(union node *cmd, int flags)
{
static const struct builtincmd null_bltin = {
* be an error to break out of more loops than exist, but it isn't
* in the standard shell so we don't make it one here.
*/
-static int
+static int FAST_FUNC
breakcmd(int argc UNUSED_PARAM, char **argv)
{
int n = argv[1] ? number(argv[1]) : 1;
popstackmark(&smark);
}
-static void
+static void FAST_FUNC
changemail(const char *val UNUSED_PARAM)
{
mail_var_path_changed = 1;
/*
* The shift builtin command.
*/
-static int
+static int FAST_FUNC
shiftcmd(int argc UNUSED_PARAM, char **argv)
{
int n;
/*
* The set command builtin.
*/
-static int
+static int FAST_FUNC
setcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
int retval;
}
#if ENABLE_ASH_RANDOM_SUPPORT
-static void
+static void FAST_FUNC
change_random(const char *value)
{
/* Galois LFSR parameter */
* be processed in the current argument. If shellparam.optnext is NULL,
* then it's the first time getopts has been called.
*/
-static int
+static int FAST_FUNC
getoptscmd(int argc, char **argv)
{
char **optbase;
/*
* The eval command.
*/
-static int
+static int FAST_FUNC
evalcmd(int argc UNUSED_PARAM, char **argv)
{
char *p;
/* NOTREACHED */
}
-static int
+static int FAST_FUNC
dotcmd(int argc, char **argv)
{
struct strlist *sp;
return status;
}
-static int
+static int FAST_FUNC
exitcmd(int argc UNUSED_PARAM, char **argv)
{
if (stoppedjobs())
/*
* The trap builtin.
*/
-static int
+static int FAST_FUNC
trapcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
char *action;
/*
* Lists available builtins
*/
-static int
+static int FAST_FUNC
helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
unsigned col;
/*
* The export and readonly commands.
*/
-static int
+static int FAST_FUNC
exportcmd(int argc UNUSED_PARAM, char **argv)
{
struct var *vp;
* variable to allow a function to be unset when there is a readonly variable
* with the same name.
*/
-static int
+static int FAST_FUNC
unsetcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
char **ap;
0
};
-static int
+static int FAST_FUNC
timescmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
long clk_tck, s, t;
*
* Copyright (C) 2003 Vladimir Oleynik <dzo@simtreas.ru>
*/
-static int
+static int FAST_FUNC
letcmd(int argc UNUSED_PARAM, char **argv)
{
arith_t i;
* -d DELIM End on DELIM char, not newline
* -e Use line editing (tty only)
*/
-static int
+static int FAST_FUNC
readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
static const char *const arg_REPLY[] = { "REPLY", NULL };
return status;
}
-static int
+static int FAST_FUNC
umaskcmd(int argc UNUSED_PARAM, char **argv)
{
static const char permuser[3] ALIGN1 = "ugo";
}
}
-static int
+static int FAST_FUNC
ulimitcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
int c;
smallint promptmode; /* 0: PS1, 1: PS2 */
#endif
FILE *file;
- int (*get) (struct in_str *);
- int (*peek) (struct in_str *);
+ int (*get) (struct in_str *) FAST_FUNC;
+ int (*peek) (struct in_str *) FAST_FUNC;
} in_str;
#define i_getch(input) ((input)->get(input))
#define i_peek(input) ((input)->peek(input))
/* Function prototypes for builtins */
-static int builtin_cd(char **argv);
-static int builtin_echo(char **argv);
-static int builtin_eval(char **argv);
-static int builtin_exec(char **argv);
-static int builtin_exit(char **argv);
-static int builtin_export(char **argv);
+static int builtin_cd(char **argv) FAST_FUNC;
+static int builtin_echo(char **argv) FAST_FUNC;
+static int builtin_eval(char **argv) FAST_FUNC;
+static int builtin_exec(char **argv) FAST_FUNC;
+static int builtin_exit(char **argv) FAST_FUNC;
+static int builtin_export(char **argv) FAST_FUNC;
#if ENABLE_HUSH_JOB
-static int builtin_fg_bg(char **argv);
-static int builtin_jobs(char **argv);
+static int builtin_fg_bg(char **argv) FAST_FUNC;
+static int builtin_jobs(char **argv) FAST_FUNC;
#endif
#if ENABLE_HUSH_HELP
-static int builtin_help(char **argv);
+static int builtin_help(char **argv) FAST_FUNC;
#endif
#if ENABLE_HUSH_LOCAL
-static int builtin_local(char **argv);
+static int builtin_local(char **argv) FAST_FUNC;
#endif
#if HUSH_DEBUG
-static int builtin_memleak(char **argv);
-#endif
-static int builtin_pwd(char **argv);
-static int builtin_read(char **argv);
-static int builtin_set(char **argv);
-static int builtin_shift(char **argv);
-static int builtin_source(char **argv);
-static int builtin_test(char **argv);
-static int builtin_trap(char **argv);
-static int builtin_type(char **argv);
-static int builtin_true(char **argv);
-static int builtin_umask(char **argv);
-static int builtin_unset(char **argv);
-static int builtin_wait(char **argv);
+static int builtin_memleak(char **argv) FAST_FUNC;
+#endif
+static int builtin_pwd(char **argv) FAST_FUNC;
+static int builtin_read(char **argv) FAST_FUNC;
+static int builtin_set(char **argv) FAST_FUNC;
+static int builtin_shift(char **argv) FAST_FUNC;
+static int builtin_source(char **argv) FAST_FUNC;
+static int builtin_test(char **argv) FAST_FUNC;
+static int builtin_trap(char **argv) FAST_FUNC;
+static int builtin_type(char **argv) FAST_FUNC;
+static int builtin_true(char **argv) FAST_FUNC;
+static int builtin_umask(char **argv) FAST_FUNC;
+static int builtin_unset(char **argv) FAST_FUNC;
+static int builtin_wait(char **argv) FAST_FUNC;
#if ENABLE_HUSH_LOOPS
-static int builtin_break(char **argv);
-static int builtin_continue(char **argv);
+static int builtin_break(char **argv) FAST_FUNC;
+static int builtin_continue(char **argv) FAST_FUNC;
#endif
#if ENABLE_HUSH_FUNCTIONS
-static int builtin_return(char **argv);
+static int builtin_return(char **argv) FAST_FUNC;
#endif
/* Table of built-in functions. They can be forked or not, depending on
* still be set at the end. */
struct built_in_command {
const char *cmd;
- int (*function)(char **argv);
+ int (*function)(char **argv) FAST_FUNC;
#if ENABLE_HUSH_HELP
const char *descr;
# define BLTIN(cmd, func, help) { cmd, func, help }
/*
* in_str support
*/
-static int static_get(struct in_str *i)
+static int FAST_FUNC static_get(struct in_str *i)
{
int ch = *i->p++;
if (ch != '\0')
return EOF;
}
-static int static_peek(struct in_str *i)
+static int FAST_FUNC static_peek(struct in_str *i)
{
return *i->p;
}
/* This is the magic location that prints prompts
* and gets data back from the user */
-static int file_get(struct in_str *i)
+static int FAST_FUNC file_get(struct in_str *i)
{
int ch;
/* All callers guarantee this routine will never
* be used right after a newline, so prompting is not needed.
*/
-static int file_peek(struct in_str *i)
+static int FAST_FUNC file_peek(struct in_str *i)
{
int ch;
if (i->p && *i->p) {
/*
* Built-ins
*/
-static int builtin_true(char **argv UNUSED_PARAM)
+static int FAST_FUNC builtin_true(char **argv UNUSED_PARAM)
{
return 0;
}
-static int builtin_test(char **argv)
+static int FAST_FUNC builtin_test(char **argv)
{
int argc = 0;
while (*argv) {
return test_main(argc, argv - argc);
}
-static int builtin_echo(char **argv)
+static int FAST_FUNC builtin_echo(char **argv)
{
int argc = 0;
while (*argv) {
return echo_main(argc, argv - argc);
}
-static int builtin_eval(char **argv)
+static int FAST_FUNC builtin_eval(char **argv)
{
int rcode = EXIT_SUCCESS;
return rcode;
}
-static int builtin_cd(char **argv)
+static int FAST_FUNC builtin_cd(char **argv)
{
const char *newdir = argv[1];
if (newdir == NULL) {
return EXIT_SUCCESS;
}
-static int builtin_exec(char **argv)
+static int FAST_FUNC builtin_exec(char **argv)
{
if (*++argv == NULL)
return EXIT_SUCCESS; /* bash does this */
}
}
-static int builtin_exit(char **argv)
+static int FAST_FUNC builtin_exit(char **argv)
{
debug_printf_exec("%s()\n", __func__);
} while (*++argv);
}
-static int builtin_export(char **argv)
+static int FAST_FUNC builtin_export(char **argv)
{
unsigned opt_unexport;
}
#if ENABLE_HUSH_LOCAL
-static int builtin_local(char **argv)
+static int FAST_FUNC builtin_local(char **argv)
{
if (G.func_nest_level == 0) {
bb_error_msg("%s: not in a function", argv[0]);
}
#endif
-static int builtin_trap(char **argv)
+static int FAST_FUNC builtin_trap(char **argv)
{
int sig;
char *new_cmd;
}
/* http://www.opengroup.org/onlinepubs/9699919799/utilities/type.html */
-static int builtin_type(char **argv)
+static int FAST_FUNC builtin_type(char **argv)
{
int ret = EXIT_SUCCESS;
#if ENABLE_HUSH_JOB
/* built-in 'fg' and 'bg' handler */
-static int builtin_fg_bg(char **argv)
+static int FAST_FUNC builtin_fg_bg(char **argv)
{
int i, jobnum;
struct pipe *pi;
#endif
#if ENABLE_HUSH_HELP
-static int builtin_help(char **argv UNUSED_PARAM)
+static int FAST_FUNC builtin_help(char **argv UNUSED_PARAM)
{
const struct built_in_command *x;
#endif
#if ENABLE_HUSH_JOB
-static int builtin_jobs(char **argv UNUSED_PARAM)
+static int FAST_FUNC builtin_jobs(char **argv UNUSED_PARAM)
{
struct pipe *job;
const char *status_string;
#endif
#if HUSH_DEBUG
-static int builtin_memleak(char **argv UNUSED_PARAM)
+static int FAST_FUNC builtin_memleak(char **argv UNUSED_PARAM)
{
void *p;
unsigned long l;
}
#endif
-static int builtin_pwd(char **argv UNUSED_PARAM)
+static int FAST_FUNC builtin_pwd(char **argv UNUSED_PARAM)
{
puts(set_cwd());
return EXIT_SUCCESS;
}
-static int builtin_read(char **argv)
+static int FAST_FUNC builtin_read(char **argv)
{
char *string;
const char *name = "REPLY";
*
* So far, we only support "set -- [argument...]" and some of the short names.
*/
-static int builtin_set(char **argv)
+static int FAST_FUNC builtin_set(char **argv)
{
int n;
char **pp, **g_argv;
return EXIT_FAILURE;
}
-static int builtin_shift(char **argv)
+static int FAST_FUNC builtin_shift(char **argv)
{
int n = 1;
if (argv[1]) {
return EXIT_FAILURE;
}
-static int builtin_source(char **argv)
+static int FAST_FUNC builtin_source(char **argv)
{
char *arg_path;
FILE *input;
return G.last_exitcode;
}
-static int builtin_umask(char **argv)
+static int FAST_FUNC builtin_umask(char **argv)
{
int rc;
mode_t mask;
}
/* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#unset */
-static int builtin_unset(char **argv)
+static int FAST_FUNC builtin_unset(char **argv)
{
int ret;
unsigned opts;
}
/* http://www.opengroup.org/onlinepubs/9699919799/utilities/wait.html */
-static int builtin_wait(char **argv)
+static int FAST_FUNC builtin_wait(char **argv)
{
int ret = EXIT_SUCCESS;
int status, sig;
#endif
#if ENABLE_HUSH_LOOPS
-static int builtin_break(char **argv)
+static int FAST_FUNC builtin_break(char **argv)
{
unsigned depth;
if (G.depth_of_loop == 0) {
return EXIT_SUCCESS;
}
-static int builtin_continue(char **argv)
+static int FAST_FUNC builtin_continue(char **argv)
{
G.flag_break_continue = 1; /* BC_CONTINUE = 2 = 1+1 */
return builtin_break(argv);
#endif
#if ENABLE_HUSH_FUNCTIONS
-static int builtin_return(char **argv)
+static int FAST_FUNC builtin_return(char **argv)
{
int rc;
#define SYSV_NICINOD 100
#define SYSV_NICFREE 50
-struct sysv_super
-{
+struct sysv_super {
uint16_t s_isize;
uint16_t s_pad0;
uint32_t s_fsize;
#include "volume_id_internal.h"
-struct hpfs_super
-{
+struct hpfs_super {
uint8_t magic[4];
uint8_t version;
} __attribute__((__packed__));