diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/applets.src.h | 1 | ||||
-rw-r--r-- | include/libbb.h | 18 |
2 files changed, 13 insertions, 6 deletions
diff --git a/include/applets.src.h b/include/applets.src.h index 9f3ac78cb..dac83e7fb 100644 --- a/include/applets.src.h +++ b/include/applets.src.h | |||
@@ -382,7 +382,6 @@ IF_VOLNAME(APPLET(volname, BB_DIR_USR_BIN, BB_SUID_DROP)) | |||
382 | IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) | 382 | IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) |
383 | IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) | 383 | IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) |
384 | IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) | 384 | IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) |
385 | IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
386 | IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) | 385 | IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) |
387 | IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) | 386 | IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) |
388 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) | 387 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) |
diff --git a/include/libbb.h b/include/libbb.h index 729704974..2f90b35f7 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -424,6 +424,7 @@ const char *bb_basename(const char *name) FAST_FUNC; | |||
424 | char *last_char_is(const char *s, int c) FAST_FUNC; | 424 | char *last_char_is(const char *s, int c) FAST_FUNC; |
425 | const char* endofname(const char *name) FAST_FUNC; | 425 | const char* endofname(const char *name) FAST_FUNC; |
426 | char *is_prefixed_with(const char *string, const char *key) FAST_FUNC; | 426 | char *is_prefixed_with(const char *string, const char *key) FAST_FUNC; |
427 | char *is_suffixed_with(const char *string, const char *key) FAST_FUNC; | ||
427 | 428 | ||
428 | int ndelay_on(int fd) FAST_FUNC; | 429 | int ndelay_on(int fd) FAST_FUNC; |
429 | int ndelay_off(int fd) FAST_FUNC; | 430 | int ndelay_off(int fd) FAST_FUNC; |
@@ -572,6 +573,11 @@ void xlisten(int s, int backlog) FAST_FUNC; | |||
572 | void xconnect(int s, const struct sockaddr *saddr, socklen_t addrlen) FAST_FUNC; | 573 | void xconnect(int s, const struct sockaddr *saddr, socklen_t addrlen) FAST_FUNC; |
573 | ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, | 574 | ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, |
574 | socklen_t tolen) FAST_FUNC; | 575 | socklen_t tolen) FAST_FUNC; |
576 | |||
577 | int setsockopt_int(int fd, int level, int optname, int optval) FAST_FUNC; | ||
578 | int setsockopt_1(int fd, int level, int optname) FAST_FUNC; | ||
579 | int setsockopt_SOL_SOCKET_int(int fd, int optname, int optval) FAST_FUNC; | ||
580 | int setsockopt_SOL_SOCKET_1(int fd, int optname) FAST_FUNC; | ||
575 | /* SO_REUSEADDR allows a server to rebind to an address that is already | 581 | /* SO_REUSEADDR allows a server to rebind to an address that is already |
576 | * "in use" by old connections to e.g. previous server instance which is | 582 | * "in use" by old connections to e.g. previous server instance which is |
577 | * killed or crashed. Without it bind will fail until all such connections | 583 | * killed or crashed. Without it bind will fail until all such connections |
@@ -579,6 +585,7 @@ ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, | |||
579 | * regardless of SO_REUSEADDR (unlike some other flavors of Unix). | 585 | * regardless of SO_REUSEADDR (unlike some other flavors of Unix). |
580 | * Turn it on before you call bind(). */ | 586 | * Turn it on before you call bind(). */ |
581 | void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */ | 587 | void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */ |
588 | int setsockopt_keepalive(int fd) FAST_FUNC; | ||
582 | int setsockopt_broadcast(int fd) FAST_FUNC; | 589 | int setsockopt_broadcast(int fd) FAST_FUNC; |
583 | int setsockopt_bindtodevice(int fd, const char *iface) FAST_FUNC; | 590 | int setsockopt_bindtodevice(int fd, const char *iface) FAST_FUNC; |
584 | /* NB: returns port in host byte order */ | 591 | /* NB: returns port in host byte order */ |
@@ -696,6 +703,7 @@ int bb_putchar(int ch) FAST_FUNC; | |||
696 | /* Note: does not use stdio, writes to fd 2 directly */ | 703 | /* Note: does not use stdio, writes to fd 2 directly */ |
697 | int bb_putchar_stderr(char ch) FAST_FUNC; | 704 | int bb_putchar_stderr(char ch) FAST_FUNC; |
698 | char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; | 705 | char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; |
706 | char *auto_string(char *str) FAST_FUNC; | ||
699 | // gcc-4.1.1 still isn't good enough at optimizing it | 707 | // gcc-4.1.1 still isn't good enough at optimizing it |
700 | // (+200 bytes compared to macro) | 708 | // (+200 bytes compared to macro) |
701 | //static ALWAYS_INLINE | 709 | //static ALWAYS_INLINE |
@@ -1134,9 +1142,8 @@ enum { | |||
1134 | extern const char *msg_eol; | 1142 | extern const char *msg_eol; |
1135 | extern smallint syslog_level; | 1143 | extern smallint syslog_level; |
1136 | extern smallint logmode; | 1144 | extern smallint logmode; |
1137 | extern int die_sleep; | ||
1138 | extern uint8_t xfunc_error_retval; | 1145 | extern uint8_t xfunc_error_retval; |
1139 | extern jmp_buf die_jmp; | 1146 | extern void (*die_func)(void); |
1140 | extern void xfunc_die(void) NORETURN FAST_FUNC; | 1147 | extern void xfunc_die(void) NORETURN FAST_FUNC; |
1141 | extern void bb_show_usage(void) NORETURN FAST_FUNC; | 1148 | extern void bb_show_usage(void) NORETURN FAST_FUNC; |
1142 | extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; | 1149 | extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; |
@@ -1258,7 +1265,8 @@ char *bb_ask_stdin(const char * prompt) FAST_FUNC; | |||
1258 | char *bb_ask(const int fd, int timeout, const char * prompt) FAST_FUNC; | 1265 | char *bb_ask(const int fd, int timeout, const char * prompt) FAST_FUNC; |
1259 | int bb_ask_confirmation(void) FAST_FUNC; | 1266 | int bb_ask_confirmation(void) FAST_FUNC; |
1260 | 1267 | ||
1261 | int bb_parse_mode(const char* s, mode_t* theMode) FAST_FUNC; | 1268 | /* Returns -1 if input is invalid. current_mode is a base for e.g. "u+rw" */ |
1269 | int bb_parse_mode(const char* s, unsigned cur_mode) FAST_FUNC; | ||
1262 | 1270 | ||
1263 | /* | 1271 | /* |
1264 | * Config file parser | 1272 | * Config file parser |
@@ -1832,7 +1840,7 @@ extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr | |||
1832 | #define bb_default_path (bb_PATH_root_path + sizeof("PATH=/sbin:/usr/sbin")) | 1840 | #define bb_default_path (bb_PATH_root_path + sizeof("PATH=/sbin:/usr/sbin")) |
1833 | 1841 | ||
1834 | extern const int const_int_0; | 1842 | extern const int const_int_0; |
1835 | extern const int const_int_1; | 1843 | //extern const int const_int_1; |
1836 | 1844 | ||
1837 | 1845 | ||
1838 | /* Providing hard guarantee on minimum size (think of BUFSIZ == 128) */ | 1846 | /* Providing hard guarantee on minimum size (think of BUFSIZ == 128) */ |
@@ -1918,6 +1926,7 @@ extern const char bb_default_login_shell[] ALIGN1; | |||
1918 | 1926 | ||
1919 | 1927 | ||
1920 | #define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0]))) | 1928 | #define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0]))) |
1929 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | ||
1921 | 1930 | ||
1922 | 1931 | ||
1923 | /* We redefine ctype macros. Unicode-correct handling of char types | 1932 | /* We redefine ctype macros. Unicode-correct handling of char types |
@@ -2008,7 +2017,6 @@ static ALWAYS_INLINE unsigned char bb_ascii_tolower(unsigned char a) | |||
2008 | typedef void (*bbunit_testfunc)(void); | 2017 | typedef void (*bbunit_testfunc)(void); |
2009 | 2018 | ||
2010 | struct bbunit_listelem { | 2019 | struct bbunit_listelem { |
2011 | struct bbunit_listelem* next; | ||
2012 | const char* name; | 2020 | const char* name; |
2013 | bbunit_testfunc testfunc; | 2021 | bbunit_testfunc testfunc; |
2014 | }; | 2022 | }; |