aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bb_archive.h71
-rw-r--r--include/grp_.h2
-rw-r--r--include/libbb.h72
-rw-r--r--include/pwd_.h2
-rw-r--r--include/volume_id.h2
-rw-r--r--include/xatonum.h9
6 files changed, 93 insertions, 65 deletions
diff --git a/include/bb_archive.h b/include/bb_archive.h
index 9e176d335..2043d8570 100644
--- a/include/bb_archive.h
+++ b/include/bb_archive.h
@@ -12,9 +12,10 @@ enum {
12 /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */ 12 /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */
13 /* More info at: http://tukaani.org/xz/xz-file-format.txt */ 13 /* More info at: http://tukaani.org/xz/xz-file-format.txt */
14 XZ_MAGIC1 = 256 * 0xfd + '7', 14 XZ_MAGIC1 = 256 * 0xfd + '7',
15 XZ_MAGIC2 = 256 * (256 * (256 * 'z' + 'X') + 'Z') + 0, 15 XZ_MAGIC2 = 256 * (unsigned)(256 * (256 * 'z' + 'X') + 'Z') + 0,
16 /* Different form: 32 bits, then 16 bits: */ 16 /* Different form: 32 bits, then 16 bits: */
17 XZ_MAGIC1a = 256 * (256 * (256 * 0xfd + '7') + 'z') + 'X', 17 /* (unsigned) cast suppresses "integer overflow in expression" warning */
18 XZ_MAGIC1a = 256 * (unsigned)(256 * (256 * 0xfd + '7') + 'z') + 'X',
18 XZ_MAGIC2a = 256 * 'Z' + 0, 19 XZ_MAGIC2a = 256 * 'Z' + 0,
19#else 20#else
20 COMPRESS_MAGIC = 0x9d1f, 21 COMPRESS_MAGIC = 0x9d1f,
@@ -76,19 +77,20 @@ typedef struct archive_handle_t {
76 off_t offset; 77 off_t offset;
77 78
78 /* Archiver specific. Can make it a union if it ever gets big */ 79 /* Archiver specific. Can make it a union if it ever gets big */
80#define PAX_NEXT_FILE 0
81#define PAX_GLOBAL 1
79#if ENABLE_TAR || ENABLE_DPKG || ENABLE_DPKG_DEB 82#if ENABLE_TAR || ENABLE_DPKG || ENABLE_DPKG_DEB
80 smallint tar__end; 83 smallint tar__end;
81# if ENABLE_FEATURE_TAR_GNU_EXTENSIONS 84# if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
82 char* tar__longname; 85 char* tar__longname;
83 char* tar__linkname; 86 char* tar__linkname;
84# endif 87# endif
85#if ENABLE_FEATURE_TAR_TO_COMMAND 88# if ENABLE_FEATURE_TAR_TO_COMMAND
86 char* tar__to_command; 89 char* tar__to_command;
87 const char* tar__to_command_shell; 90 const char* tar__to_command_shell;
88#endif 91# endif
89# if ENABLE_FEATURE_TAR_SELINUX 92# if ENABLE_FEATURE_TAR_SELINUX
90 char* tar__global_sctx; 93 char* tar__sctx[2];
91 char* tar__next_file_sctx;
92# endif 94# endif
93#endif 95#endif
94#if ENABLE_CPIO || ENABLE_RPM2CPIO || ENABLE_RPM 96#if ENABLE_CPIO || ENABLE_RPM2CPIO || ENABLE_RPM
@@ -154,12 +156,6 @@ struct BUG_tar_header {
154 156
155 157
156 158
157/* Info struct unpackers can fill out to inform users of thing like
158 * timestamps of unpacked files */
159typedef struct unpack_info_t {
160 time_t mtime;
161} unpack_info_t;
162
163archive_handle_t *init_handle(void) FAST_FUNC; 159archive_handle_t *init_handle(void) FAST_FUNC;
164 160
165char filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC; 161char filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC;
@@ -202,40 +198,47 @@ int start_bunzip(bunzip_data **bdp, int in_fd, const void *inbuf, int len) FAST_
202int read_bunzip(bunzip_data *bd, char *outbuf, int len) FAST_FUNC; 198int read_bunzip(bunzip_data *bd, char *outbuf, int len) FAST_FUNC;
203void dealloc_bunzip(bunzip_data *bd) FAST_FUNC; 199void dealloc_bunzip(bunzip_data *bd) FAST_FUNC;
204 200
205typedef struct inflate_unzip_result { 201/* Meaning and direction (input/output) of the fields are transformer-specific */
206 off_t bytes_out; 202typedef struct transformer_aux_data_t {
207 uint32_t crc; 203 smallint check_signature; /* most often referenced member */
208} inflate_unzip_result; 204 off_t bytes_out;
209 205 off_t bytes_in; /* used in unzip code only: needs to know packed size */
210IF_DESKTOP(long long) int inflate_unzip(inflate_unzip_result *res, off_t compr_size, int src_fd, int dst_fd) FAST_FUNC; 206 uint32_t crc32;
211/* xz unpacker takes .xz stream from offset 6 */ 207 time_t mtime; /* gunzip code may set this on exit */
212IF_DESKTOP(long long) int unpack_xz_stream(int src_fd, int dst_fd) FAST_FUNC; 208} transformer_aux_data_t;
213/* lzma unpacker takes .lzma stream from offset 0 */ 209
214IF_DESKTOP(long long) int unpack_lzma_stream(int src_fd, int dst_fd) FAST_FUNC; 210void init_transformer_aux_data(transformer_aux_data_t *aux) FAST_FUNC;
215/* the rest wants 2 first bytes already skipped by the caller */ 211int FAST_FUNC check_signature16(transformer_aux_data_t *aux, int src_fd, unsigned magic16) FAST_FUNC;
216IF_DESKTOP(long long) int unpack_bz2_stream(int src_fd, int dst_fd) FAST_FUNC; 212
217IF_DESKTOP(long long) int unpack_gz_stream(int src_fd, int dst_fd) FAST_FUNC; 213IF_DESKTOP(long long) int inflate_unzip(transformer_aux_data_t *aux, int src_fd, int dst_fd) FAST_FUNC;
218IF_DESKTOP(long long) int unpack_gz_stream_with_info(int src_fd, int dst_fd, unpack_info_t *info) FAST_FUNC; 214IF_DESKTOP(long long) int unpack_Z_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) FAST_FUNC;
219IF_DESKTOP(long long) int unpack_Z_stream(int src_fd, int dst_fd) FAST_FUNC; 215IF_DESKTOP(long long) int unpack_gz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) FAST_FUNC;
220/* wrapper which checks first two bytes to be "BZ" */ 216IF_DESKTOP(long long) int unpack_bz2_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) FAST_FUNC;
221IF_DESKTOP(long long) int unpack_bz2_stream_prime(int src_fd, int dst_fd) FAST_FUNC; 217IF_DESKTOP(long long) int unpack_lzma_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) FAST_FUNC;
218IF_DESKTOP(long long) int unpack_xz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) FAST_FUNC;
222 219
223char* append_ext(char *filename, const char *expected_ext) FAST_FUNC; 220char* append_ext(char *filename, const char *expected_ext) FAST_FUNC;
224int bbunpack(char **argv, 221int bbunpack(char **argv,
225 IF_DESKTOP(long long) int FAST_FUNC (*unpacker)(unpack_info_t *info), 222 IF_DESKTOP(long long) int FAST_FUNC (*unpacker)(transformer_aux_data_t *aux),
226 char* FAST_FUNC (*make_new_name)(char *filename, const char *expected_ext), 223 char* FAST_FUNC (*make_new_name)(char *filename, const char *expected_ext),
227 const char *expected_ext 224 const char *expected_ext
228) FAST_FUNC; 225) FAST_FUNC;
229 226
227void check_errors_in_children(int signo);
230#if BB_MMU 228#if BB_MMU
231void open_transformer(int fd, 229void open_transformer(int fd,
232 IF_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd)) FAST_FUNC; 230 int check_signature,
233#define open_transformer(fd, transformer, transform_prog) open_transformer(fd, transformer) 231 IF_DESKTOP(long long) int FAST_FUNC (*transformer)(transformer_aux_data_t *aux, int src_fd, int dst_fd)
232) FAST_FUNC;
233#define open_transformer_with_sig(fd, transformer, transform_prog) open_transformer((fd), 1, (transformer))
234#define open_transformer_with_no_sig(fd, transformer) open_transformer((fd), 0, (transformer))
234#else 235#else
235void open_transformer(int src_fd, const char *transform_prog) FAST_FUNC; 236void open_transformer(int fd, const char *transform_prog) FAST_FUNC;
236#define open_transformer(fd, transformer, transform_prog) open_transformer(fd, transform_prog) 237#define open_transformer_with_sig(fd, transformer, transform_prog) open_transformer((fd), (transform_prog))
238/* open_transformer_with_no_sig() does not exist on NOMMU */
237#endif 239#endif
238 240
241
239POP_SAVED_FUNCTION_VISIBILITY 242POP_SAVED_FUNCTION_VISIBILITY
240 243
241#endif 244#endif
diff --git a/include/grp_.h b/include/grp_.h
index 5c24d558a..82ad90492 100644
--- a/include/grp_.h
+++ b/include/grp_.h
@@ -29,7 +29,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
29 * We will use libc-defined structures, but will #define function names 29 * We will use libc-defined structures, but will #define function names
30 * so that function calls are directed to bb_internal_XXX replacements 30 * so that function calls are directed to bb_internal_XXX replacements
31 */ 31 */
32 32#undef endgrent
33#define setgrent bb_internal_setgrent 33#define setgrent bb_internal_setgrent
34#define endgrent bb_internal_endgrent 34#define endgrent bb_internal_endgrent
35#define getgrent bb_internal_getgrent 35#define getgrent bb_internal_getgrent
diff --git a/include/libbb.h b/include/libbb.h
index a6ecac932..e776951f0 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -51,6 +51,20 @@
51#include <termios.h> 51#include <termios.h>
52#include <time.h> 52#include <time.h>
53#include <sys/param.h> 53#include <sys/param.h>
54#include <pwd.h>
55#include <grp.h>
56#if ENABLE_FEATURE_SHADOWPASSWDS
57# if !ENABLE_USE_BB_SHADOW
58/* If using busybox's shadow implementation, do not include the shadow.h
59 * header as the toolchain may not provide it at all.
60 */
61# include <shadow.h>
62# endif
63#endif
64#if defined(ANDROID) || defined(__ANDROID__)
65# define endpwent() ((void)0)
66# define endgrent() ((void)0)
67#endif
54#ifdef HAVE_MNTENT_H 68#ifdef HAVE_MNTENT_H
55# include <mntent.h> 69# include <mntent.h>
56#endif 70#endif
@@ -80,16 +94,6 @@
80#ifdef DMALLOC 94#ifdef DMALLOC
81# include <dmalloc.h> 95# include <dmalloc.h>
82#endif 96#endif
83#include <pwd.h>
84#include <grp.h>
85#if ENABLE_FEATURE_SHADOWPASSWDS
86# if !ENABLE_USE_BB_SHADOW
87/* If using busybox's shadow implementation, do not include the shadow.h
88 * header as the toolchain may not provide it at all.
89 */
90# include <shadow.h>
91# endif
92#endif
93/* Just in case libc doesn't define some of these... */ 97/* Just in case libc doesn't define some of these... */
94#ifndef _PATH_PASSWD 98#ifndef _PATH_PASSWD
95#define _PATH_PASSWD "/etc/passwd" 99#define _PATH_PASSWD "/etc/passwd"
@@ -224,7 +228,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
224# if ULONG_MAX > 0xffffffff 228# if ULONG_MAX > 0xffffffff
225/* "long" is long enough on this system */ 229/* "long" is long enough on this system */
226typedef unsigned long uoff_t; 230typedef unsigned long uoff_t;
227# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX) 231# define XATOOFF(a) xatoul_range((a), 0, LONG_MAX)
228/* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */ 232/* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */
229# define BB_STRTOOFF bb_strtoul 233# define BB_STRTOOFF bb_strtoul
230# define STRTOOFF strtoul 234# define STRTOOFF strtoul
@@ -233,7 +237,7 @@ typedef unsigned long uoff_t;
233# else 237# else
234/* "long" is too short, need "long long" */ 238/* "long" is too short, need "long long" */
235typedef unsigned long long uoff_t; 239typedef unsigned long long uoff_t;
236# define XATOOFF(a) xatoull_range(a, 0, LLONG_MAX) 240# define XATOOFF(a) xatoull_range((a), 0, LLONG_MAX)
237# define BB_STRTOOFF bb_strtoull 241# define BB_STRTOOFF bb_strtoull
238# define STRTOOFF strtoull 242# define STRTOOFF strtoull
239# define OFF_FMT "ll" 243# define OFF_FMT "ll"
@@ -250,7 +254,7 @@ typedef unsigned long uoff_t;
250# define OFF_FMT "l" 254# define OFF_FMT "l"
251# else 255# else
252typedef unsigned long uoff_t; 256typedef unsigned long uoff_t;
253# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX) 257# define XATOOFF(a) xatoul_range((a), 0, LONG_MAX)
254# define BB_STRTOOFF bb_strtoul 258# define BB_STRTOOFF bb_strtoul
255# define STRTOOFF strtol 259# define STRTOOFF strtol
256# define OFF_FMT "l" 260# define OFF_FMT "l"
@@ -258,6 +262,12 @@ typedef unsigned long uoff_t;
258#endif 262#endif
259/* scary. better ideas? (but do *test* them first!) */ 263/* scary. better ideas? (but do *test* them first!) */
260#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) 264#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1)))
265/* Users report bionic to use 32-bit off_t even if LARGEFILE support is requested.
266 * We misdetected that. Don't let it build:
267 */
268struct BUG_off_t_size_is_misdetected {
269 char BUG_off_t_size_is_misdetected[sizeof(off_t) == sizeof(uoff_t) ? 1 : -1];
270};
261 271
262/* Some useful definitions */ 272/* Some useful definitions */
263#undef FALSE 273#undef FALSE
@@ -321,7 +331,7 @@ extern char *strrstr(const char *haystack, const char *needle) FAST_FUNC;
321 331
322//TODO: supply a pointer to char[11] buffer (avoid statics)? 332//TODO: supply a pointer to char[11] buffer (avoid statics)?
323extern const char *bb_mode_string(mode_t mode) FAST_FUNC; 333extern const char *bb_mode_string(mode_t mode) FAST_FUNC;
324extern int is_directory(const char *name, int followLinks, struct stat *statBuf) FAST_FUNC; 334extern int is_directory(const char *name, int followLinks) FAST_FUNC;
325enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ 335enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */
326 FILEUTILS_PRESERVE_STATUS = 1 << 0, /* -p */ 336 FILEUTILS_PRESERVE_STATUS = 1 << 0, /* -p */
327 FILEUTILS_DEREFERENCE = 1 << 1, /* !-d */ 337 FILEUTILS_DEREFERENCE = 1 << 1, /* !-d */
@@ -571,12 +581,7 @@ enum {
571 * and if kernel doesn't support it, fall back to IPv4. 581 * and if kernel doesn't support it, fall back to IPv4.
572 * This is useful if you plan to bind to resulting local lsa. 582 * This is useful if you plan to bind to resulting local lsa.
573 */ 583 */
574#if ENABLE_FEATURE_IPV6
575int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type) FAST_FUNC; 584int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type) FAST_FUNC;
576#else
577int xsocket_type(len_and_sockaddr **lsap, int sock_type) FAST_FUNC;
578#define xsocket_type(lsap, af, sock_type) xsocket_type((lsap), (sock_type))
579#endif
580int xsocket_stream(len_and_sockaddr **lsap) FAST_FUNC; 585int xsocket_stream(len_and_sockaddr **lsap) FAST_FUNC;
581/* Create server socket bound to bindaddr:port. bindaddr can be NULL, 586/* Create server socket bound to bindaddr:port. bindaddr can be NULL,
582 * numeric IP ("N.N.N.N") or numeric IPv6 address, 587 * numeric IP ("N.N.N.N") or numeric IPv6 address,
@@ -721,17 +726,23 @@ extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
721extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 726extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
722/* Never returns NULL */ 727/* Never returns NULL */
723extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 728extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
724/* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */ 729
725#if ENABLE_FEATURE_SEAMLESS_LZMA \ 730#define SEAMLESS_COMPRESSION (0 \
731 || ENABLE_FEATURE_SEAMLESS_XZ \
732 || ENABLE_FEATURE_SEAMLESS_LZMA \
726 || ENABLE_FEATURE_SEAMLESS_BZ2 \ 733 || ENABLE_FEATURE_SEAMLESS_BZ2 \
727 || ENABLE_FEATURE_SEAMLESS_GZ \ 734 || ENABLE_FEATURE_SEAMLESS_GZ \
728 /* || ENABLE_FEATURE_SEAMLESS_Z */ 735 || ENABLE_FEATURE_SEAMLESS_Z)
729extern void setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) FAST_FUNC; 736
730#else 737#if SEAMLESS_COMPRESSION
731# define setup_unzip_on_fd(...) ((void)0) 738/* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */
732#endif 739extern int setup_unzip_on_fd(int fd, int fail_if_not_detected) FAST_FUNC;
733/* Autodetects .gz etc */ 740/* Autodetects .gz etc */
734extern int open_zipped(const char *fname) FAST_FUNC; 741extern int open_zipped(const char *fname) FAST_FUNC;
742#else
743# define setup_unzip_on_fd(...) (0)
744# define open_zipped(fname) open((fname), O_RDONLY);
745#endif
735extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 746extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
736 747
737extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC; 748extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC;
@@ -982,6 +993,7 @@ enum {
982 DAEMON_DEVNULL_STDIO = 2, 993 DAEMON_DEVNULL_STDIO = 2,
983 DAEMON_CLOSE_EXTRA_FDS = 4, 994 DAEMON_CLOSE_EXTRA_FDS = 4,
984 DAEMON_ONLY_SANITIZE = 8, /* internal use */ 995 DAEMON_ONLY_SANITIZE = 8, /* internal use */
996 DAEMON_DOUBLE_FORK = 16, /* double fork to avoid controlling tty */
985}; 997};
986#if BB_MMU 998#if BB_MMU
987 enum { re_execed = 0 }; 999 enum { re_execed = 0 };
@@ -990,6 +1002,9 @@ enum {
990# define bb_daemonize(flags) bb_daemonize_or_rexec(flags, bogus) 1002# define bb_daemonize(flags) bb_daemonize_or_rexec(flags, bogus)
991#else 1003#else
992 extern bool re_execed; 1004 extern bool re_execed;
1005 /* Note: re_exec() and fork_or_rexec() do argv[0][0] |= 0x80 on NOMMU!
1006 * _Parent_ needs to undo it if it doesn't want to have argv[0] mangled.
1007 */
993 void re_exec(char **argv) NORETURN FAST_FUNC; 1008 void re_exec(char **argv) NORETURN FAST_FUNC;
994 pid_t fork_or_rexec(char **argv) FAST_FUNC; 1009 pid_t fork_or_rexec(char **argv) FAST_FUNC;
995 int BUG_fork_is_unavailable_on_nommu(void) FAST_FUNC; 1010 int BUG_fork_is_unavailable_on_nommu(void) FAST_FUNC;
@@ -1197,13 +1212,14 @@ enum {
1197 PARSE_MIN_DIE = 0x00100000, // die if < min tokens found 1212 PARSE_MIN_DIE = 0x00100000, // die if < min tokens found
1198 // keep a copy of current line 1213 // keep a copy of current line
1199 PARSE_KEEP_COPY = 0x00200000 * ENABLE_FEATURE_CROND_D, 1214 PARSE_KEEP_COPY = 0x00200000 * ENABLE_FEATURE_CROND_D,
1200// PARSE_ESCAPE = 0x00400000, // process escape sequences in tokens 1215 PARSE_EOL_COMMENTS = 0x00400000, // comments are recognized even if they aren't the first char
1201 // NORMAL is: 1216 // NORMAL is:
1202 // * remove leading and trailing delimiters and collapse 1217 // * remove leading and trailing delimiters and collapse
1203 // multiple delimiters into one 1218 // multiple delimiters into one
1204 // * warn and continue if less than mintokens delimiters found 1219 // * warn and continue if less than mintokens delimiters found
1205 // * grab everything into last token 1220 // * grab everything into last token
1206 PARSE_NORMAL = PARSE_COLLAPSE | PARSE_TRIM | PARSE_GREEDY, 1221 // * comments are recognized even if they aren't the first char
1222 PARSE_NORMAL = PARSE_COLLAPSE | PARSE_TRIM | PARSE_GREEDY | PARSE_EOL_COMMENTS,
1207}; 1223};
1208typedef struct parser_t { 1224typedef struct parser_t {
1209 FILE *fp; 1225 FILE *fp;
diff --git a/include/pwd_.h b/include/pwd_.h
index e40b71dab..ea158da45 100644
--- a/include/pwd_.h
+++ b/include/pwd_.h
@@ -30,7 +30,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
30 * We will use libc-defined structures, but will #define function names 30 * We will use libc-defined structures, but will #define function names
31 * so that function calls are directed to bb_internal_XXX replacements 31 * so that function calls are directed to bb_internal_XXX replacements
32 */ 32 */
33 33#undef endpwent
34#define setpwent bb_internal_setpwent 34#define setpwent bb_internal_setpwent
35#define endpwent bb_internal_endpwent 35#define endpwent bb_internal_endpwent
36#define getpwent bb_internal_getpwent 36#define getpwent bb_internal_getpwent
diff --git a/include/volume_id.h b/include/volume_id.h
index 4a78cd1e4..a83da899e 100644
--- a/include/volume_id.h
+++ b/include/volume_id.h
@@ -20,7 +20,7 @@
20 20
21char *get_devname_from_label(const char *spec); 21char *get_devname_from_label(const char *spec);
22char *get_devname_from_uuid(const char *spec); 22char *get_devname_from_uuid(const char *spec);
23void display_uuid_cache(void); 23void display_uuid_cache(int scan_devices);
24 24
25/* Returns: 25/* Returns:
26 * 0: no UUID= or LABEL= prefix found 26 * 0: no UUID= or LABEL= prefix found
diff --git a/include/xatonum.h b/include/xatonum.h
index 6f76a3c96..45ebbfc00 100644
--- a/include/xatonum.h
+++ b/include/xatonum.h
@@ -168,6 +168,15 @@ uint32_t bb_strtou32(const char *arg, char **endp, int base)
168 return bb_strtoul(arg, endp, base); 168 return bb_strtoul(arg, endp, base);
169 return BUG_bb_strtou32_unimplemented(); 169 return BUG_bb_strtou32_unimplemented();
170} 170}
171static ALWAYS_INLINE
172int32_t bb_strtoi32(const char *arg, char **endp, int base)
173{
174 if (sizeof(int32_t) == sizeof(int))
175 return bb_strtoi(arg, endp, base);
176 if (sizeof(int32_t) == sizeof(long))
177 return bb_strtol(arg, endp, base);
178 return BUG_bb_strtou32_unimplemented();
179}
171 180
172/* Floating point */ 181/* Floating point */
173 182