aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2014-12-14 14:20:56 +0000
committerRon Yorston <rmy@pobox.com>2014-12-14 14:20:56 +0000
commit6d6d18d45c145899fce3a39553771cf0af671f30 (patch)
tree1936d18cbf61b9e0989464aad0a11c52cbeff7b7 /include/libbb.h
parent0c204dc07b718244c360e0b84df66ce0a012e14f (diff)
parentacb8be721768b54075a51d1859d390904a0f1f6c (diff)
downloadbusybox-w32-6d6d18d45c145899fce3a39553771cf0af671f30.tar.gz
busybox-w32-6d6d18d45c145899fce3a39553771cf0af671f30.tar.bz2
busybox-w32-6d6d18d45c145899fce3a39553771cf0af671f30.zip
Merge branch 'busybox' into merge
Conflicts: archival/libarchive/open_transformer.c libbb/lineedit.c miscutils/man.c
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 21a56d78f..802779932 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -744,11 +744,14 @@ extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST
744/* Never returns NULL */ 744/* Never returns NULL */
745extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 745extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
746 746
747#if defined ARG_MAX 747#if defined(ARG_MAX) && (ARG_MAX >= 60*1024 || !defined(_SC_ARG_MAX))
748/* Use _constant_ maximum if: defined && (big enough || no variable one exists) */
748# define bb_arg_max() ((unsigned)ARG_MAX) 749# define bb_arg_max() ((unsigned)ARG_MAX)
749#elif defined _SC_ARG_MAX 750#elif defined(_SC_ARG_MAX)
751/* Else use variable one (a bit more expensive) */
750unsigned bb_arg_max(void) FAST_FUNC; 752unsigned bb_arg_max(void) FAST_FUNC;
751#else 753#else
754/* If all else fails */
752# define bb_arg_max() ((unsigned)(32 * 1024)) 755# define bb_arg_max() ((unsigned)(32 * 1024))
753#endif 756#endif
754unsigned bb_clk_tck(void) FAST_FUNC; 757unsigned bb_clk_tck(void) FAST_FUNC;
@@ -765,11 +768,12 @@ unsigned bb_clk_tck(void) FAST_FUNC;
765extern int setup_unzip_on_fd(int fd, int fail_if_not_compressed) FAST_FUNC; 768extern int setup_unzip_on_fd(int fd, int fail_if_not_compressed) FAST_FUNC;
766/* Autodetects .gz etc */ 769/* Autodetects .gz etc */
767extern int open_zipped(const char *fname, int fail_if_not_compressed) FAST_FUNC; 770extern int open_zipped(const char *fname, int fail_if_not_compressed) FAST_FUNC;
771extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
768#else 772#else
769# define setup_unzip_on_fd(...) (0) 773# define setup_unzip_on_fd(...) (0)
770# define open_zipped(fname, fail_if_not_compressed) open((fname), O_RDONLY); 774# define open_zipped(fname, fail_if_not_compressed) open((fname), O_RDONLY);
775# define xmalloc_open_zipped_read_close(fname, maxsz_p) xmalloc_open_read_close((fname), (maxsz_p))
771#endif 776#endif
772extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
773 777
774extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC; 778extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC;
775// NB: will return short write on error, not -1, 779// NB: will return short write on error, not -1,
@@ -1120,6 +1124,7 @@ extern void bb_perror_nomsg_and_die(void) NORETURN FAST_FUNC;
1120extern void bb_perror_nomsg(void) FAST_FUNC; 1124extern void bb_perror_nomsg(void) FAST_FUNC;
1121extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; 1125extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
1122extern void bb_verror_msg(const char *s, va_list p, const char *strerr) FAST_FUNC; 1126extern void bb_verror_msg(const char *s, va_list p, const char *strerr) FAST_FUNC;
1127extern void bb_logenv_override(void) FAST_FUNC;
1123 1128
1124/* We need to export XXX_main from libbusybox 1129/* We need to export XXX_main from libbusybox
1125 * only if we build "individual" binaries 1130 * only if we build "individual" binaries