diff options
author | Ron Yorston <rmy@pobox.com> | 2017-07-18 15:58:52 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-07-18 15:58:52 +0100 |
commit | b680f05ad449505e3d914bebd4c8d83bf768c094 (patch) | |
tree | c08ded13d430b0e7e0104f2eb594fad190ce98a3 /include | |
parent | 258200ff81d5a9da54dab35acf36213eff1e399b (diff) | |
parent | 513a2457b65894b10b9fd6aa8753fca59eced08c (diff) | |
download | busybox-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.h | 13 | ||||
-rw-r--r-- | include/platform.h | 6 |
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 | ||
802 | uint16_t inet_cksum(uint16_t *addr, int len) FAST_FUNC; | 802 | uint16_t inet_cksum(uint16_t *addr, int len) FAST_FUNC; |
803 | 803 | ||
804 | /* 0 if argv[0] is NULL: */ | ||
805 | unsigned string_array_len(char **argv) FAST_FUNC; | ||
804 | void overlapping_strcpy(char *dst, const char *src) FAST_FUNC; | 806 | void overlapping_strcpy(char *dst, const char *src) FAST_FUNC; |
805 | char *safe_strncpy(char *dst, const char *src, size_t size) FAST_FUNC; | 807 | char *safe_strncpy(char *dst, const char *src, size_t size) FAST_FUNC; |
806 | char *strncpy_IFNAMSIZ(char *dst, const char *src) FAST_FUNC; | 808 | char *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 | */ | ||
1070 | gid_t *bb_getgroups(int *ngroups, gid_t *group_array) FAST_FUNC; | ||
1060 | 1071 | ||
1061 | #if ENABLE_FEATURE_UTMP | 1072 | #if ENABLE_FEATURE_UTMP |
1062 | void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname); | 1073 | void 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; | |||
1132 | int run_nofork_applet(int applet_no, char **argv) FAST_FUNC; | 1143 | int run_nofork_applet(int applet_no, char **argv) FAST_FUNC; |
1133 | #ifndef BUILD_INDIVIDUAL | 1144 | #ifndef BUILD_INDIVIDUAL |
1134 | extern int find_applet_by_name(const char *name) FAST_FUNC; | 1145 | extern int find_applet_by_name(const char *name) FAST_FUNC; |
1135 | extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC; | 1146 | extern 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 | ||