X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Flibbb.h;h=5f25b5ddeb02222e68636514bd7ef55a650a514d;hb=cbdc37cae079d6b52ca39fb6c1dd6eadab48b617;hp=95a7470a8277b1adbc5a4328b6d991cd09701c3f;hpb=200bcc851acbe1ba30fe90b5cf918f88370a5d15;p=oweals%2Fbusybox.git diff --git a/include/libbb.h b/include/libbb.h index 95a7470a8..5f25b5dde 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -162,6 +162,17 @@ #ifndef HAVE_XTABS # define XTABS TAB3 #endif +/* + * Use '%m' to append error string on platforms that support it, + * '%s' and strerror() on those that don't. + */ +#ifdef HAVE_PRINTF_PERCENTM +# define STRERROR_FMT "%m" +# define STRERROR_ERRNO /*nothing*/ +#else +# define STRERROR_FMT "%s" +# define STRERROR_ERRNO ,strerror(errno) +#endif /* Some libc's forget to declare these, do it ourself */ @@ -1212,7 +1223,7 @@ uint32_t getopt32long(char **argv, const char *optstring, const char *longopts, * By ~2008, OpenBSD 3.4 was changed to survive glibc-like optind = 0 * (to interpret it as if optreset was set). */ -#ifdef __GLIBC__ +#if 1 /*def __GLIBC__*/ #define GETOPT_RESET() (optind = 0) #else /* BSD style */ #define GETOPT_RESET() (optind = 1) @@ -1582,6 +1593,7 @@ int tcsetattr_stdin_TCSANOW(const struct termios *tp) FAST_FUNC; #define TERMIOS_CLEAR_ISIG (1 << 0) #define TERMIOS_RAW_CRNL (1 << 1) #define TERMIOS_RAW_INPUT (1 << 2) +int get_termios_and_make_raw(int fd, struct termios *newterm, struct termios *oldterm, int flags) FAST_FUNC; int set_termios_to_raw(int fd, struct termios *oldterm, int flags) FAST_FUNC; /* NB: "unsigned request" is crucial! "int request" will break some arches! */ @@ -1993,10 +2005,16 @@ extern const char bb_path_wtmp_file[] ALIGN1; #define bb_dev_null "/dev/null" extern const char bb_busybox_exec_path[] ALIGN1; -/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, - * but I want to save a few bytes here */ -extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ +/* allow default system PATH to be extended via CFLAGS */ +#ifndef BB_ADDITIONAL_PATH +#define BB_ADDITIONAL_PATH "" +#endif +#define BB_PATH_ROOT_PATH "PATH=/sbin:/usr/sbin:/bin:/usr/bin" BB_ADDITIONAL_PATH +extern const char bb_PATH_root_path[] ALIGN1; /* BB_PATH_ROOT_PATH */ #define bb_default_root_path (bb_PATH_root_path + sizeof("PATH")) +/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, + * but I want to save a few bytes here: + */ #define bb_default_path (bb_PATH_root_path + sizeof("PATH=/sbin:/usr/sbin")) extern const int const_int_0;