aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.src.h1
-rw-r--r--include/libbb.h18
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))
382IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) 382IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP))
383IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) 383IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP))
384IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) 384IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP))
385IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP))
386IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) 385IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP))
387IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) 386IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami))
388IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) 387IF_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;
424char *last_char_is(const char *s, int c) FAST_FUNC; 424char *last_char_is(const char *s, int c) FAST_FUNC;
425const char* endofname(const char *name) FAST_FUNC; 425const char* endofname(const char *name) FAST_FUNC;
426char *is_prefixed_with(const char *string, const char *key) FAST_FUNC; 426char *is_prefixed_with(const char *string, const char *key) FAST_FUNC;
427char *is_suffixed_with(const char *string, const char *key) FAST_FUNC;
427 428
428int ndelay_on(int fd) FAST_FUNC; 429int ndelay_on(int fd) FAST_FUNC;
429int ndelay_off(int fd) FAST_FUNC; 430int ndelay_off(int fd) FAST_FUNC;
@@ -572,6 +573,11 @@ void xlisten(int s, int backlog) FAST_FUNC;
572void xconnect(int s, const struct sockaddr *saddr, socklen_t addrlen) FAST_FUNC; 573void xconnect(int s, const struct sockaddr *saddr, socklen_t addrlen) FAST_FUNC;
573ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, 574ssize_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
577int setsockopt_int(int fd, int level, int optname, int optval) FAST_FUNC;
578int setsockopt_1(int fd, int level, int optname) FAST_FUNC;
579int setsockopt_SOL_SOCKET_int(int fd, int optname, int optval) FAST_FUNC;
580int 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(). */
581void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */ 587void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */
588int setsockopt_keepalive(int fd) FAST_FUNC;
582int setsockopt_broadcast(int fd) FAST_FUNC; 589int setsockopt_broadcast(int fd) FAST_FUNC;
583int setsockopt_bindtodevice(int fd, const char *iface) FAST_FUNC; 590int 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 */
697int bb_putchar_stderr(char ch) FAST_FUNC; 704int bb_putchar_stderr(char ch) FAST_FUNC;
698char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; 705char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC;
706char *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 {
1134extern const char *msg_eol; 1142extern const char *msg_eol;
1135extern smallint syslog_level; 1143extern smallint syslog_level;
1136extern smallint logmode; 1144extern smallint logmode;
1137extern int die_sleep;
1138extern uint8_t xfunc_error_retval; 1145extern uint8_t xfunc_error_retval;
1139extern jmp_buf die_jmp; 1146extern void (*die_func)(void);
1140extern void xfunc_die(void) NORETURN FAST_FUNC; 1147extern void xfunc_die(void) NORETURN FAST_FUNC;
1141extern void bb_show_usage(void) NORETURN FAST_FUNC; 1148extern void bb_show_usage(void) NORETURN FAST_FUNC;
1142extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; 1149extern 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;
1258char *bb_ask(const int fd, int timeout, const char * prompt) FAST_FUNC; 1265char *bb_ask(const int fd, int timeout, const char * prompt) FAST_FUNC;
1259int bb_ask_confirmation(void) FAST_FUNC; 1266int bb_ask_confirmation(void) FAST_FUNC;
1260 1267
1261int 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" */
1269int 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
1834extern const int const_int_0; 1842extern const int const_int_0;
1835extern 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)
2008typedef void (*bbunit_testfunc)(void); 2017typedef void (*bbunit_testfunc)(void);
2009 2018
2010struct bbunit_listelem { 2019struct 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};