aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2014-01-02 10:25:11 +0000
committerRon Yorston <rmy@pobox.com>2014-01-02 10:25:11 +0000
commitb8f278ee745778806118f57fb7884d205eba05ad (patch)
treefef237f6dd302c59918cf389a60c120e58d3e086 /include/libbb.h
parent3fd34651ea72ea1c335d3170f234cb0517fd897f (diff)
parent57434022cefde87133b8ad39fb3b79c1274e7684 (diff)
downloadbusybox-w32-b8f278ee745778806118f57fb7884d205eba05ad.tar.gz
busybox-w32-b8f278ee745778806118f57fb7884d205eba05ad.tar.bz2
busybox-w32-b8f278ee745778806118f57fb7884d205eba05ad.zip
Merge branch 'busybox' into merge
Conflicts: archival/Config.src shell/ash.c
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 9adb037ca..e516f0ee3 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -32,12 +32,12 @@
32#include <stdarg.h> 32#include <stdarg.h>
33#include <stddef.h> 33#include <stddef.h>
34#include <string.h> 34#include <string.h>
35/* There are two incompatible basename's, let not use them! */ 35/* There are two incompatible basename's, let's not use them! */
36/* See the dirname/basename man page for details */ 36/* See the dirname/basename man page for details */
37#include <libgen.h> /* dirname,basename */ 37#include <libgen.h> /* dirname,basename */
38#undef basename 38#undef basename
39#define basename dont_use_basename 39#define basename dont_use_basename
40#include <sys/poll.h> 40#include <poll.h>
41#include <sys/ioctl.h> 41#include <sys/ioctl.h>
42#include <sys/mman.h> 42#include <sys/mman.h>
43#include <sys/socket.h> 43#include <sys/socket.h>
@@ -474,6 +474,8 @@ void record_signo(int signo); /* not FAST_FUNC! */
474 474
475void xsetgid(gid_t gid) FAST_FUNC; 475void xsetgid(gid_t gid) FAST_FUNC;
476void xsetuid(uid_t uid) FAST_FUNC; 476void xsetuid(uid_t uid) FAST_FUNC;
477void xsetegid(gid_t egid) FAST_FUNC;
478void xseteuid(uid_t euid) FAST_FUNC;
477void xchdir(const char *path) FAST_FUNC; 479void xchdir(const char *path) FAST_FUNC;
478void xchroot(const char *path) FAST_FUNC; 480void xchroot(const char *path) FAST_FUNC;
479void xsetenv(const char *key, const char *value) FAST_FUNC; 481void xsetenv(const char *key, const char *value) FAST_FUNC;
@@ -482,11 +484,12 @@ void bb_unsetenv_and_free(char *key) FAST_FUNC;
482void xunlink(const char *pathname) FAST_FUNC; 484void xunlink(const char *pathname) FAST_FUNC;
483void xstat(const char *pathname, struct stat *buf) FAST_FUNC; 485void xstat(const char *pathname, struct stat *buf) FAST_FUNC;
484void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC; 486void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC;
487int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC;
488int open_or_warn(const char *pathname, int flags) FAST_FUNC;
489int xopen3(const char *pathname, int flags, int mode) FAST_FUNC;
485int xopen(const char *pathname, int flags) FAST_FUNC; 490int xopen(const char *pathname, int flags) FAST_FUNC;
486int xopen_nonblocking(const char *pathname) FAST_FUNC; 491int xopen_nonblocking(const char *pathname) FAST_FUNC;
487int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; 492int xopen_as_uid_gid(const char *pathname, int flags, uid_t u, gid_t g) FAST_FUNC;
488int open_or_warn(const char *pathname, int flags) FAST_FUNC;
489int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC;
490int open_or_warn_stdin(const char *pathname) FAST_FUNC; 493int open_or_warn_stdin(const char *pathname) FAST_FUNC;
491int xopen_stdin(const char *pathname) FAST_FUNC; 494int xopen_stdin(const char *pathname) FAST_FUNC;
492void xrename(const char *oldpath, const char *newpath) FAST_FUNC; 495void xrename(const char *oldpath, const char *newpath) FAST_FUNC;
@@ -831,8 +834,8 @@ char *itoa(int n) FAST_FUNC;
831char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC; 834char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC;
832char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC; 835char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC;
833/* Intelligent formatters of bignums */ 836/* Intelligent formatters of bignums */
834void smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) FAST_FUNC; 837char *smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) FAST_FUNC;
835void smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC; 838char *smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC;
836/* If block_size == 0, display size without fractional part, 839/* If block_size == 0, display size without fractional part,
837 * else display (size * block_size) with one decimal digit. 840 * else display (size * block_size) with one decimal digit.
838 * If display_unit == 0, show value no bigger than 1024 with suffix (K,M,G...), 841 * If display_unit == 0, show value no bigger than 1024 with suffix (K,M,G...),
@@ -1313,8 +1316,10 @@ int sd_listen_fds(void);
1313#define SETUP_ENV_CLEARENV (1 << 1) 1316#define SETUP_ENV_CLEARENV (1 << 1)
1314#define SETUP_ENV_TO_TMP (1 << 2) 1317#define SETUP_ENV_TO_TMP (1 << 2)
1315#define SETUP_ENV_NO_CHDIR (1 << 4) 1318#define SETUP_ENV_NO_CHDIR (1 << 4)
1316extern void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC; 1319void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC;
1317extern int correct_password(const struct passwd *pw) FAST_FUNC; 1320void nuke_str(char *str) FAST_FUNC;
1321int ask_and_check_password_extended(const struct passwd *pw, int timeout, const char *prompt) FAST_FUNC;
1322int ask_and_check_password(const struct passwd *pw) FAST_FUNC;
1318/* Returns a malloced string */ 1323/* Returns a malloced string */
1319#if !ENABLE_USE_BB_CRYPT 1324#if !ENABLE_USE_BB_CRYPT
1320#define pw_encrypt(clear, salt, cleanup) pw_encrypt(clear, salt) 1325#define pw_encrypt(clear, salt, cleanup) pw_encrypt(clear, salt)
@@ -1793,6 +1798,11 @@ extern struct globals *const ptr_to_globals;
1793 (*(struct globals**)&ptr_to_globals) = (void*)(x); \ 1798 (*(struct globals**)&ptr_to_globals) = (void*)(x); \
1794 barrier(); \ 1799 barrier(); \
1795} while (0) 1800} while (0)
1801#define FREE_PTR_TO_GLOBALS() do { \
1802 if (ENABLE_FEATURE_CLEAN_UP) { \
1803 free(ptr_to_globals); \
1804 } \
1805} while (0)
1796 1806
1797/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it, 1807/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it,
1798 * use bb_default_login_shell and following defines. 1808 * use bb_default_login_shell and following defines.