aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2017-07-18 15:58:52 +0100
committerRon Yorston <rmy@pobox.com>2017-07-18 15:58:52 +0100
commitb680f05ad449505e3d914bebd4c8d83bf768c094 (patch)
treec08ded13d430b0e7e0104f2eb594fad190ce98a3 /include
parent258200ff81d5a9da54dab35acf36213eff1e399b (diff)
parent513a2457b65894b10b9fd6aa8753fca59eced08c (diff)
downloadbusybox-w32-b680f05ad449505e3d914bebd4c8d83bf768c094.tar.gz
busybox-w32-b680f05ad449505e3d914bebd4c8d83bf768c094.tar.bz2
busybox-w32-b680f05ad449505e3d914bebd4c8d83bf768c094.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h13
-rw-r--r--include/platform.h6
2 files changed, 18 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 0bc8cf29e..c58cbc250 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -801,6 +801,8 @@ ssize_t recv_from_to(int fd, void *buf, size_t len, int flags,
801 801
802uint16_t inet_cksum(uint16_t *addr, int len) FAST_FUNC; 802uint16_t inet_cksum(uint16_t *addr, int len) FAST_FUNC;
803 803
804/* 0 if argv[0] is NULL: */
805unsigned string_array_len(char **argv) FAST_FUNC;
804void overlapping_strcpy(char *dst, const char *src) FAST_FUNC; 806void overlapping_strcpy(char *dst, const char *src) FAST_FUNC;
805char *safe_strncpy(char *dst, const char *src, size_t size) FAST_FUNC; 807char *safe_strncpy(char *dst, const char *src, size_t size) FAST_FUNC;
806char *strncpy_IFNAMSIZ(char *dst, const char *src) FAST_FUNC; 808char *strncpy_IFNAMSIZ(char *dst, const char *src) FAST_FUNC;
@@ -1057,6 +1059,15 @@ void die_if_bad_username(const char* name) FAST_FUNC;
1057#else 1059#else
1058#define die_if_bad_username(name) ((void)(name)) 1060#define die_if_bad_username(name) ((void)(name))
1059#endif 1061#endif
1062/*
1063 * Returns (-1) terminated malloced result of getgroups().
1064 * Reallocs group_array (useful for repeated calls).
1065 * ngroups is an initial size of array. It is rounded up to 32 for realloc.
1066 * ngroups is updated on return.
1067 * ngroups can be NULL: bb_getgroups(NULL, NULL) is valid usage.
1068 * Dies on errors (on Linux, only xrealloc can cause this, not internal getgroups call).
1069 */
1070gid_t *bb_getgroups(int *ngroups, gid_t *group_array) FAST_FUNC;
1060 1071
1061#if ENABLE_FEATURE_UTMP 1072#if ENABLE_FEATURE_UTMP
1062void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname); 1073void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname);
@@ -1132,7 +1143,7 @@ int spawn_and_wait(char **argv) FAST_FUNC;
1132int run_nofork_applet(int applet_no, char **argv) FAST_FUNC; 1143int run_nofork_applet(int applet_no, char **argv) FAST_FUNC;
1133#ifndef BUILD_INDIVIDUAL 1144#ifndef BUILD_INDIVIDUAL
1134extern int find_applet_by_name(const char *name) FAST_FUNC; 1145extern int find_applet_by_name(const char *name) FAST_FUNC;
1135extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC; 1146extern void run_applet_no_and_exit(int a, const char *name, char **argv) NORETURN FAST_FUNC;
1136#endif 1147#endif
1137 1148
1138/* Helpers for daemonization. 1149/* Helpers for daemonization.
diff --git a/include/platform.h b/include/platform.h
index 13f818202..5ae82427a 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -264,6 +264,12 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING;
264} while (0) 264} while (0)
265#endif 265#endif
266 266
267/* Unaligned, fixed-endian accessors */
268#define get_unaligned_le32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_LE32(v); })
269#define get_unaligned_be32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_BE32(v); })
270#define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val))
271#define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val))
272
267 273
268/* ---- Size-saving "small" ints (arch-dependent) ----------- */ 274/* ---- Size-saving "small" ints (arch-dependent) ----------- */
269 275