diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-01-27 08:24:39 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-01-27 08:24:39 +0000 |
commit | ed3ef50c233ffb1b50ea0e7382a8e60b86491009 (patch) | |
tree | ecb05ce51890c2cf84ad036543a972ac812320c3 | |
parent | ab050f5522e843bf08994685134adaaac7ffd392 (diff) | |
download | busybox-w32-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.tar.gz busybox-w32-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.tar.bz2 busybox-w32-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.zip |
Fix header file usage -- there were many unnecessary header files included in
busybox.h which slowed compiles. I left only what was needed and then fixed up
all the apps to include their own header files. I also fixed naming for pwd.h
and grp.h functions. Tested to compile and run with libc5, glibc, and uClibc.
-Erik
-rw-r--r-- | Config.h | 8 | ||||
-rw-r--r-- | Makefile | 21 | ||||
-rw-r--r-- | applets/busybox.c | 1 | ||||
-rw-r--r-- | ar.c | 4 | ||||
-rw-r--r-- | archival/ar.c | 4 | ||||
-rw-r--r-- | archival/dpkg_deb.c | 3 | ||||
-rw-r--r-- | archival/gzip.c | 1 | ||||
-rw-r--r-- | archival/tar.c | 3 | ||||
-rw-r--r-- | basename.c | 3 | ||||
-rw-r--r-- | busybox.c | 1 | ||||
-rw-r--r-- | busybox.h | 32 | ||||
-rw-r--r-- | cat.c | 2 | ||||
-rw-r--r-- | chmod_chown_chgrp.c | 3 | ||||
-rw-r--r-- | chroot.c | 1 | ||||
-rw-r--r-- | clear.c | 1 | ||||
-rw-r--r-- | cmp.c | 1 | ||||
-rw-r--r-- | console-tools/clear.c | 1 | ||||
-rw-r--r-- | console-tools/dumpkmap.c | 3 | ||||
-rw-r--r-- | console-tools/loadkmap.c | 3 | ||||
-rw-r--r-- | console-tools/reset.c | 1 | ||||
-rw-r--r-- | coreutils/basename.c | 3 | ||||
-rw-r--r-- | coreutils/cat.c | 2 | ||||
-rw-r--r-- | coreutils/chroot.c | 1 | ||||
-rw-r--r-- | coreutils/cmp.c | 1 | ||||
-rw-r--r-- | coreutils/date.c | 1 | ||||
-rw-r--r-- | coreutils/dd.c | 4 | ||||
-rw-r--r-- | coreutils/df.c | 2 | ||||
-rw-r--r-- | coreutils/dirname.c | 2 | ||||
-rw-r--r-- | coreutils/du.c | 4 | ||||
-rw-r--r-- | coreutils/echo.c | 2 | ||||
-rw-r--r-- | coreutils/expr.c | 4 | ||||
-rw-r--r-- | coreutils/head.c | 2 | ||||
-rw-r--r-- | coreutils/hostid.c | 2 | ||||
-rw-r--r-- | coreutils/id.c | 1 | ||||
-rw-r--r-- | coreutils/ln.c | 3 | ||||
-rw-r--r-- | coreutils/logname.c | 2 | ||||
-rw-r--r-- | coreutils/ls.c | 1 | ||||
-rw-r--r-- | coreutils/mkdir.c | 2 | ||||
-rw-r--r-- | coreutils/mkfifo.c | 1 | ||||
-rw-r--r-- | coreutils/mknod.c | 2 | ||||
-rw-r--r-- | coreutils/pwd.c | 2 | ||||
-rw-r--r-- | coreutils/rm.c | 2 | ||||
-rw-r--r-- | coreutils/rmdir.c | 2 | ||||
-rw-r--r-- | coreutils/sleep.c | 2 | ||||
-rw-r--r-- | coreutils/sort.c | 2 | ||||
-rw-r--r-- | coreutils/sync.c | 1 | ||||
-rw-r--r-- | coreutils/tail.c | 6 | ||||
-rw-r--r-- | coreutils/touch.c | 2 | ||||
-rw-r--r-- | coreutils/tr.c | 4 | ||||
-rw-r--r-- | coreutils/tty.c | 2 | ||||
-rw-r--r-- | coreutils/uname.c | 1 | ||||
-rw-r--r-- | coreutils/uniq.c | 2 | ||||
-rw-r--r-- | coreutils/uudecode.c | 4 | ||||
-rw-r--r-- | coreutils/uuencode.c | 1 | ||||
-rw-r--r-- | coreutils/wc.c | 1 | ||||
-rw-r--r-- | coreutils/whoami.c | 2 | ||||
-rw-r--r-- | coreutils/yes.c | 1 | ||||
-rw-r--r-- | cp_mv.c | 1 | ||||
-rw-r--r-- | date.c | 1 | ||||
-rw-r--r-- | dd.c | 4 | ||||
-rw-r--r-- | df.c | 2 | ||||
-rw-r--r-- | dirname.c | 2 | ||||
-rw-r--r-- | dmesg.c | 4 | ||||
-rw-r--r-- | dpkg_deb.c | 3 | ||||
-rw-r--r-- | du.c | 4 | ||||
-rw-r--r-- | dumpkmap.c | 3 | ||||
-rw-r--r-- | dutmp.c | 4 | ||||
-rw-r--r-- | echo.c | 2 | ||||
-rw-r--r-- | editors/sed.c | 2 | ||||
-rw-r--r-- | expr.c | 4 | ||||
-rw-r--r-- | fbset.c | 1 | ||||
-rw-r--r-- | fdflush.c | 1 | ||||
-rw-r--r-- | find.c | 2 | ||||
-rw-r--r-- | findutils/find.c | 2 | ||||
-rw-r--r-- | findutils/grep.c | 2 | ||||
-rw-r--r-- | findutils/which.c | 2 | ||||
-rw-r--r-- | free.c | 1 | ||||
-rw-r--r-- | freeramdisk.c | 1 | ||||
-rw-r--r-- | grep.c | 2 | ||||
-rw-r--r-- | gzip.c | 1 | ||||
-rw-r--r-- | head.c | 2 | ||||
-rw-r--r-- | hostid.c | 2 | ||||
-rw-r--r-- | hostname.c | 3 | ||||
-rw-r--r-- | id.c | 1 | ||||
-rw-r--r-- | include/busybox.h | 32 | ||||
-rw-r--r-- | include/grp.h | 28 | ||||
-rw-r--r-- | include/pwd.h | 29 | ||||
-rw-r--r-- | init.c | 3 | ||||
-rw-r--r-- | init/init.c | 3 | ||||
-rw-r--r-- | insmod.c | 7 | ||||
-rw-r--r-- | kill.c | 1 | ||||
-rw-r--r-- | ln.c | 3 | ||||
-rw-r--r-- | loadkmap.c | 3 | ||||
-rw-r--r-- | logger.c | 2 | ||||
-rw-r--r-- | logname.c | 2 | ||||
-rw-r--r-- | ls.c | 1 | ||||
-rw-r--r-- | miscutils/dutmp.c | 4 | ||||
-rw-r--r-- | miscutils/mktemp.c | 2 | ||||
-rw-r--r-- | miscutils/mt.c | 1 | ||||
-rw-r--r-- | miscutils/readlink.c | 1 | ||||
-rw-r--r-- | miscutils/update.c | 3 | ||||
-rw-r--r-- | miscutils/watchdog.c | 2 | ||||
-rw-r--r-- | mkdir.c | 2 | ||||
-rw-r--r-- | mkfifo.c | 1 | ||||
-rw-r--r-- | mknod.c | 2 | ||||
-rw-r--r-- | mktemp.c | 2 | ||||
-rw-r--r-- | modutils/insmod.c | 7 | ||||
-rw-r--r-- | modutils/rmmod.c | 3 | ||||
-rw-r--r-- | more.c | 1 | ||||
-rw-r--r-- | mt.c | 1 | ||||
-rw-r--r-- | networking/hostname.c | 3 | ||||
-rw-r--r-- | networking/nslookup.c | 3 | ||||
-rw-r--r-- | networking/ping.c | 5 | ||||
-rw-r--r-- | networking/wget.c | 16 | ||||
-rw-r--r-- | nslookup.c | 3 | ||||
-rw-r--r-- | ping.c | 5 | ||||
-rw-r--r-- | procps/free.c | 1 | ||||
-rw-r--r-- | procps/kill.c | 1 | ||||
-rw-r--r-- | procps/ps.c | 2 | ||||
-rw-r--r-- | procps/renice.c | 1 | ||||
-rw-r--r-- | procps/uptime.c | 1 | ||||
-rw-r--r-- | ps.c | 2 | ||||
-rw-r--r-- | pwd.c | 2 | ||||
-rw-r--r-- | rdate.c | 2 | ||||
-rw-r--r-- | readlink.c | 1 | ||||
-rw-r--r-- | renice.c | 1 | ||||
-rw-r--r-- | reset.c | 1 | ||||
-rw-r--r-- | rm.c | 2 | ||||
-rw-r--r-- | rmdir.c | 2 | ||||
-rw-r--r-- | rmmod.c | 3 | ||||
-rw-r--r-- | rpmunpack.c | 3 | ||||
-rw-r--r-- | sed.c | 2 | ||||
-rw-r--r-- | sleep.c | 2 | ||||
-rw-r--r-- | sort.c | 2 | ||||
-rw-r--r-- | swaponoff.c | 5 | ||||
-rw-r--r-- | sync.c | 1 | ||||
-rw-r--r-- | sysklogd/logger.c | 2 | ||||
-rw-r--r-- | sysklogd/syslogd.c | 4 | ||||
-rw-r--r-- | syslogd.c | 4 | ||||
-rw-r--r-- | tail.c | 6 | ||||
-rw-r--r-- | tar.c | 3 | ||||
-rw-r--r-- | touch.c | 2 | ||||
-rw-r--r-- | tr.c | 4 | ||||
-rw-r--r-- | true_false.c | 1 | ||||
-rw-r--r-- | tty.c | 2 | ||||
-rw-r--r-- | umount.c | 2 | ||||
-rw-r--r-- | uname.c | 1 | ||||
-rw-r--r-- | uniq.c | 2 | ||||
-rw-r--r-- | update.c | 3 | ||||
-rw-r--r-- | uptime.c | 1 | ||||
-rw-r--r-- | util-linux/dmesg.c | 4 | ||||
-rw-r--r-- | util-linux/fbset.c | 1 | ||||
-rw-r--r-- | util-linux/fdflush.c | 1 | ||||
-rw-r--r-- | util-linux/freeramdisk.c | 1 | ||||
-rw-r--r-- | util-linux/more.c | 1 | ||||
-rw-r--r-- | util-linux/rdate.c | 2 | ||||
-rw-r--r-- | util-linux/swaponoff.c | 5 | ||||
-rw-r--r-- | util-linux/umount.c | 2 | ||||
-rw-r--r-- | utility.c | 8 | ||||
-rw-r--r-- | uudecode.c | 4 | ||||
-rw-r--r-- | uuencode.c | 1 | ||||
-rw-r--r-- | watchdog.c | 2 | ||||
-rw-r--r-- | wc.c | 1 | ||||
-rw-r--r-- | wget.c | 16 | ||||
-rw-r--r-- | which.c | 2 | ||||
-rw-r--r-- | whoami.c | 2 | ||||
-rw-r--r-- | yes.c | 1 |
167 files changed, 388 insertions, 156 deletions
@@ -330,13 +330,9 @@ | |||
330 | #endif | 330 | #endif |
331 | #endif | 331 | #endif |
332 | // | 332 | // |
333 | #if defined BB_FEATURE_LINUXRC || defined BB_LINUXRC | ||
334 | #ifndef BB_INIT | 333 | #ifndef BB_INIT |
335 | #define BB_INIT | 334 | #undef BB_LINUXRC |
336 | #endif | 335 | #undef BB_FEATURE_LINUXRC |
337 | #ifndef BB_LINUXRC | ||
338 | #define BB_LINUXRC | ||
339 | #endif | ||
340 | #endif | 336 | #endif |
341 | // | 337 | // |
342 | #ifdef BB_GZIP | 338 | #ifdef BB_GZIP |
@@ -81,24 +81,19 @@ CROSS = | |||
81 | CC = $(CROSS)gcc | 81 | CC = $(CROSS)gcc |
82 | STRIPTOOL = $(CROSS)strip | 82 | STRIPTOOL = $(CROSS)strip |
83 | 83 | ||
84 | # To compile vs an alternative libc, you may need to use/adjust | 84 | # To compile vs uClibc, just use the compiler wrapper built by uClibc... |
85 | # the following lines to meet your needs. This is how I make | 85 | # Isn't that easy? Right now, uClibc needs BB_FEATURE_NFSMOUNT disabled |
86 | # busybox compile staticly with uClibc (needs BB_FEATURE_NFSMOUNT | 86 | # since uClibc's nfs support isn't ready yet. |
87 | # disabled at the moment). Note the _full_ path for LIBCDIR. | 87 | #CC = ../uClibc/extra/gcc-uClibc/gcc-uClibc-i386 |
88 | # This is because make doesn't do ~ expansion... | 88 | |
89 | #LIBCDIR=/home/andersen/CVS/uClibc | 89 | # To compile vs some other alternative libc, you may need to use/adjust |
90 | # the following lines to meet your needs... | ||
91 | #LIBCDIR=/usr/i486-linuxlibc1/ | ||
90 | #LDFLAGS+=-nostdlib | 92 | #LDFLAGS+=-nostdlib |
91 | #LIBRARIES = $(LIBCDIR)/libc.a -lgcc | 93 | #LIBRARIES = $(LIBCDIR)/libc.a -lgcc |
92 | #CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR) | 94 | #CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR) |
93 | #GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp") | 95 | #GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp") |
94 | 96 | ||
95 | # This is how I compile with the uClibc shared lib... | ||
96 | #LIBCDIR=/home/andersen/CVS/uClibc | ||
97 | #LDFLAGS+=-nostdlib | ||
98 | #LIBRARIES = -luClibc -lgcc $(LIBCDIR)/crt0.o | ||
99 | #CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR) | ||
100 | #GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp") | ||
101 | |||
102 | #-------------------------------------------------------- | 97 | #-------------------------------------------------------- |
103 | 98 | ||
104 | # use '-Os' optimization if available, else use -O2 | 99 | # use '-Os' optimization if available, else use -O2 |
diff --git a/applets/busybox.c b/applets/busybox.c index 5eb9dfa64..ab3762eb8 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <string.h> | 4 | #include <string.h> |
5 | #include <errno.h> | 5 | #include <errno.h> |
6 | #include <stdlib.h> | ||
6 | 7 | ||
7 | #undef APPLET | 8 | #undef APPLET |
8 | #undef APPLET_NOUSAGE | 9 | #undef APPLET_NOUSAGE |
@@ -23,6 +23,10 @@ | |||
23 | * | 23 | * |
24 | */ | 24 | */ |
25 | #include <fcntl.h> | 25 | #include <fcntl.h> |
26 | #include <string.h> | ||
27 | #include <stdlib.h> | ||
28 | #include <getopt.h> | ||
29 | #include <unistd.h> | ||
26 | #include "busybox.h" | 30 | #include "busybox.h" |
27 | 31 | ||
28 | typedef struct ar_headers_s { | 32 | typedef struct ar_headers_s { |
diff --git a/archival/ar.c b/archival/ar.c index 596574e6a..550b2a1c4 100644 --- a/archival/ar.c +++ b/archival/ar.c | |||
@@ -23,6 +23,10 @@ | |||
23 | * | 23 | * |
24 | */ | 24 | */ |
25 | #include <fcntl.h> | 25 | #include <fcntl.h> |
26 | #include <string.h> | ||
27 | #include <stdlib.h> | ||
28 | #include <getopt.h> | ||
29 | #include <unistd.h> | ||
26 | #include "busybox.h" | 30 | #include "busybox.h" |
27 | 31 | ||
28 | typedef struct ar_headers_s { | 32 | typedef struct ar_headers_s { |
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c index 35904950f..3a789379b 100644 --- a/archival/dpkg_deb.c +++ b/archival/dpkg_deb.c | |||
@@ -17,6 +17,9 @@ | |||
17 | #include <stdio.h> | 17 | #include <stdio.h> |
18 | #include <stdlib.h> | 18 | #include <stdlib.h> |
19 | #include <fcntl.h> | 19 | #include <fcntl.h> |
20 | #include <unistd.h> | ||
21 | #include <string.h> | ||
22 | #include <stdlib.h> | ||
20 | #include "busybox.h" | 23 | #include "busybox.h" |
21 | 24 | ||
22 | typedef struct ar_headers_s { | 25 | typedef struct ar_headers_s { |
diff --git a/archival/gzip.c b/archival/gzip.c index 09260929e..5a74868c1 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -45,6 +45,7 @@ | |||
45 | */ | 45 | */ |
46 | #include <stdio.h> | 46 | #include <stdio.h> |
47 | #include <string.h> | 47 | #include <string.h> |
48 | #include <unistd.h> | ||
48 | #define memzero(s, n) memset ((void *)(s), 0, (n)) | 49 | #define memzero(s, n) memset ((void *)(s), 0, (n)) |
49 | 50 | ||
50 | #ifndef RETSIGTYPE | 51 | #ifndef RETSIGTYPE |
diff --git a/archival/tar.c b/archival/tar.c index 51a857d71..2c7169bcc 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -52,6 +52,9 @@ | |||
52 | #include <sys/sysmacros.h> | 52 | #include <sys/sysmacros.h> |
53 | #include <getopt.h> | 53 | #include <getopt.h> |
54 | #include <fnmatch.h> | 54 | #include <fnmatch.h> |
55 | #include <string.h> | ||
56 | #include <stdlib.h> | ||
57 | #include <unistd.h> | ||
55 | 58 | ||
56 | #ifdef BB_FEATURE_TAR_GZIP | 59 | #ifdef BB_FEATURE_TAR_GZIP |
57 | extern int unzip(int in, int out); | 60 | extern int unzip(int in, int out); |
diff --git a/basename.c b/basename.c index fcc7d4619..0caae39a4 100644 --- a/basename.c +++ b/basename.c | |||
@@ -22,7 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdlib.h> |
26 | #include <string.h> | ||
26 | 27 | ||
27 | extern int basename_main(int argc, char **argv) | 28 | extern int basename_main(int argc, char **argv) |
28 | { | 29 | { |
@@ -3,6 +3,7 @@ | |||
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <string.h> | 4 | #include <string.h> |
5 | #include <errno.h> | 5 | #include <errno.h> |
6 | #include <stdlib.h> | ||
6 | 7 | ||
7 | #undef APPLET | 8 | #undef APPLET |
8 | #undef APPLET_NOUSAGE | 9 | #undef APPLET_NOUSAGE |
@@ -26,19 +26,10 @@ | |||
26 | 26 | ||
27 | #include "Config.h" | 27 | #include "Config.h" |
28 | 28 | ||
29 | #include <stdlib.h> | 29 | #include <stdio.h> |
30 | #include <stdarg.h> | 30 | #include <stdarg.h> |
31 | #include <string.h> | ||
32 | #include <unistd.h> | ||
33 | #include <errno.h> | ||
34 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
35 | #include <sys/param.h> | ||
36 | #include <sys/types.h> | 32 | #include <sys/types.h> |
37 | #include <mntent.h> | ||
38 | #include <regex.h> | ||
39 | /* for the _syscall() macros */ | ||
40 | #include <sys/syscall.h> | ||
41 | #include <linux/unistd.h> | ||
42 | 33 | ||
43 | #ifdef DMALLOC | 34 | #ifdef DMALLOC |
44 | #include "dmalloc.h" | 35 | #include "dmalloc.h" |
@@ -69,26 +60,6 @@ static inline int is_octal(ch) { return ((ch >= '0') && (ch <= '7')); } | |||
69 | #endif | 60 | #endif |
70 | 61 | ||
71 | 62 | ||
72 | /* I don't like nested includes, but the string and io functions are used | ||
73 | * too often | ||
74 | */ | ||
75 | #include <stdio.h> | ||
76 | #if !defined(NO_STRING_H) || defined(STDC_HEADERS) | ||
77 | # include <string.h> | ||
78 | # if !defined(STDC_HEADERS) && !defined(NO_MEMORY_H) && !defined(__GNUC__) | ||
79 | # include <memory.h> | ||
80 | # endif | ||
81 | # define memzero(s, n) memset ((void *)(s), 0, (n)) | ||
82 | #else | ||
83 | # include <strings.h> | ||
84 | # define strchr index | ||
85 | # define strrchr rindex | ||
86 | # define memcpy(d, s, n) bcopy((s), (d), (n)) | ||
87 | # define memcmp(s1, s2, n) bcmp((s1), (s2), (n)) | ||
88 | # define memzero(s, n) bzero((s), (n)) | ||
89 | #endif | ||
90 | |||
91 | |||
92 | enum Location { | 63 | enum Location { |
93 | _BB_DIR_ROOT = 0, | 64 | _BB_DIR_ROOT = 0, |
94 | _BB_DIR_BIN, | 65 | _BB_DIR_BIN, |
@@ -179,7 +150,6 @@ extern void print_file(FILE *file); | |||
179 | extern int print_file_by_name(char *filename); | 150 | extern int print_file_by_name(char *filename); |
180 | extern char process_escape_sequence(char **ptr); | 151 | extern char process_escape_sequence(char **ptr); |
181 | extern char *get_last_path_component(char *path); | 152 | extern char *get_last_path_component(char *path); |
182 | extern void xregcomp(regex_t *preg, const char *regex, int cflags); | ||
183 | extern FILE *wfopen(const char *path, const char *mode); | 153 | extern FILE *wfopen(const char *path, const char *mode); |
184 | extern FILE *xfopen(const char *path, const char *mode); | 154 | extern FILE *xfopen(const char *path, const char *mode); |
185 | 155 | ||
@@ -22,7 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdlib.h> |
26 | 26 | ||
27 | extern int cat_main(int argc, char **argv) | 27 | extern int cat_main(int argc, char **argv) |
28 | { | 28 | { |
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c index f6ecfd6f8..08ea6eea0 100644 --- a/chmod_chown_chgrp.c +++ b/chmod_chown_chgrp.c | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "messages.c" | 29 | #include "messages.c" |
30 | 30 | ||
31 | #include <stdio.h> | 31 | #include <stdio.h> |
32 | #include <stdlib.h> | ||
33 | #include <string.h> | ||
34 | #include <unistd.h> | ||
32 | 35 | ||
33 | 36 | ||
34 | static long uid = -1; | 37 | static long uid = -1; |
@@ -25,6 +25,7 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <unistd.h> | ||
28 | #include <errno.h> | 29 | #include <errno.h> |
29 | 30 | ||
30 | int chroot_main(int argc, char **argv) | 31 | int chroot_main(int argc, char **argv) |
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <stdlib.h> | ||
27 | 28 | ||
28 | 29 | ||
29 | extern int clear_main(int argc, char **argv) | 30 | extern int clear_main(int argc, char **argv) |
@@ -26,6 +26,7 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <string.h> | 27 | #include <string.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <stdlib.h> | ||
29 | 30 | ||
30 | int cmp_main(int argc, char **argv) | 31 | int cmp_main(int argc, char **argv) |
31 | { | 32 | { |
diff --git a/console-tools/clear.c b/console-tools/clear.c index ca83f3820..98eef1d78 100644 --- a/console-tools/clear.c +++ b/console-tools/clear.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <stdlib.h> | ||
27 | 28 | ||
28 | 29 | ||
29 | extern int clear_main(int argc, char **argv) | 30 | extern int clear_main(int argc, char **argv) |
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c index b438ba271..b2067b30c 100644 --- a/console-tools/dumpkmap.c +++ b/console-tools/dumpkmap.c | |||
@@ -24,6 +24,9 @@ | |||
24 | #include <errno.h> | 24 | #include <errno.h> |
25 | #include <fcntl.h> | 25 | #include <fcntl.h> |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <unistd.h> | ||
28 | #include <string.h> | ||
29 | #include <stdlib.h> | ||
27 | #include <sys/ioctl.h> | 30 | #include <sys/ioctl.h> |
28 | 31 | ||
29 | /* From <linux/kd.h> */ | 32 | /* From <linux/kd.h> */ |
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c index 43c1cc795..75b40da9a 100644 --- a/console-tools/loadkmap.c +++ b/console-tools/loadkmap.c | |||
@@ -24,6 +24,9 @@ | |||
24 | #include <errno.h> | 24 | #include <errno.h> |
25 | #include <fcntl.h> | 25 | #include <fcntl.h> |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <string.h> | ||
28 | #include <stdlib.h> | ||
29 | #include <unistd.h> | ||
27 | #include <sys/ioctl.h> | 30 | #include <sys/ioctl.h> |
28 | 31 | ||
29 | #define BINARY_KEYMAP_MAGIC "bkeymap" | 32 | #define BINARY_KEYMAP_MAGIC "bkeymap" |
diff --git a/console-tools/reset.c b/console-tools/reset.c index bf8c3ed45..861bd435b 100644 --- a/console-tools/reset.c +++ b/console-tools/reset.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include "busybox.h" | 26 | #include "busybox.h" |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <stdlib.h> | ||
28 | 29 | ||
29 | extern int reset_main(int argc, char **argv) | 30 | extern int reset_main(int argc, char **argv) |
30 | { | 31 | { |
diff --git a/coreutils/basename.c b/coreutils/basename.c index fcc7d4619..0caae39a4 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c | |||
@@ -22,7 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdlib.h> |
26 | #include <string.h> | ||
26 | 27 | ||
27 | extern int basename_main(int argc, char **argv) | 28 | extern int basename_main(int argc, char **argv) |
28 | { | 29 | { |
diff --git a/coreutils/cat.c b/coreutils/cat.c index 151ce4e61..a1b878258 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c | |||
@@ -22,7 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdlib.h> |
26 | 26 | ||
27 | extern int cat_main(int argc, char **argv) | 27 | extern int cat_main(int argc, char **argv) |
28 | { | 28 | { |
diff --git a/coreutils/chroot.c b/coreutils/chroot.c index 91d3407f2..e6f1d034b 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <unistd.h> | ||
28 | #include <errno.h> | 29 | #include <errno.h> |
29 | 30 | ||
30 | int chroot_main(int argc, char **argv) | 31 | int chroot_main(int argc, char **argv) |
diff --git a/coreutils/cmp.c b/coreutils/cmp.c index 6b955447c..a4b6c7d49 100644 --- a/coreutils/cmp.c +++ b/coreutils/cmp.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <string.h> | 27 | #include <string.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <stdlib.h> | ||
29 | 30 | ||
30 | int cmp_main(int argc, char **argv) | 31 | int cmp_main(int argc, char **argv) |
31 | { | 32 | { |
diff --git a/coreutils/date.c b/coreutils/date.c index 73fc70511..8b6a0620d 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <unistd.h> | 31 | #include <unistd.h> |
32 | #include <time.h> | 32 | #include <time.h> |
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | #include <string.h> | ||
34 | #include <getopt.h> | 35 | #include <getopt.h> |
35 | 36 | ||
36 | 37 | ||
diff --git a/coreutils/dd.c b/coreutils/dd.c index 32eeb661c..dac9ccdf3 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -24,6 +24,10 @@ | |||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | 25 | ||
26 | #include <sys/types.h> | 26 | #include <sys/types.h> |
27 | #include <stdlib.h> | ||
28 | #include <stdio.h> | ||
29 | #include <unistd.h> | ||
30 | #include <string.h> | ||
27 | #include <fcntl.h> | 31 | #include <fcntl.h> |
28 | 32 | ||
29 | static struct suffix_mult dd_suffixes[] = { | 33 | static struct suffix_mult dd_suffixes[] = { |
diff --git a/coreutils/df.c b/coreutils/df.c index 22797fbae..0408f9f54 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
@@ -24,8 +24,10 @@ | |||
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <stdlib.h> | ||
27 | #include <mntent.h> | 28 | #include <mntent.h> |
28 | #include <sys/vfs.h> | 29 | #include <sys/vfs.h> |
30 | #include <getopt.h> | ||
29 | 31 | ||
30 | extern const char mtab_file[]; /* Defined in utility.c */ | 32 | extern const char mtab_file[]; /* Defined in utility.c */ |
31 | #ifdef BB_FEATURE_HUMAN_READABLE | 33 | #ifdef BB_FEATURE_HUMAN_READABLE |
diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 63c557a29..333f08d41 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c | |||
@@ -22,6 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <string.h> | ||
25 | 27 | ||
26 | extern int dirname_main(int argc, char **argv) | 28 | extern int dirname_main(int argc, char **argv) |
27 | { | 29 | { |
diff --git a/coreutils/du.c b/coreutils/du.c index 56a7a9a0c..9cc2a673d 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <fcntl.h> | 31 | #include <fcntl.h> |
32 | #include <dirent.h> | 32 | #include <dirent.h> |
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | #include <stdlib.h> | ||
35 | #include <getopt.h> | ||
34 | #include <errno.h> | 36 | #include <errno.h> |
35 | 37 | ||
36 | #ifdef BB_FEATURE_HUMAN_READABLE | 38 | #ifdef BB_FEATURE_HUMAN_READABLE |
@@ -185,7 +187,7 @@ int du_main(int argc, char **argv) | |||
185 | return status; | 187 | return status; |
186 | } | 188 | } |
187 | 189 | ||
188 | /* $Id: du.c,v 1.34 2001/01/22 22:35:38 rjune Exp $ */ | 190 | /* $Id: du.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ */ |
189 | /* | 191 | /* |
190 | Local Variables: | 192 | Local Variables: |
191 | c-file-style: "linux" | 193 | c-file-style: "linux" |
diff --git a/coreutils/echo.c b/coreutils/echo.c index 393f4425f..b3e01afec 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <string.h> | ||
28 | #include <stdlib.h> | ||
27 | 29 | ||
28 | extern int | 30 | extern int |
29 | echo_main(int argc, char** argv) | 31 | echo_main(int argc, char** argv) |
diff --git a/coreutils/expr.c b/coreutils/expr.c index eed2637f2..71bd22417 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
@@ -35,9 +35,11 @@ | |||
35 | 35 | ||
36 | #include "busybox.h" | 36 | #include "busybox.h" |
37 | #include <stdio.h> | 37 | #include <stdio.h> |
38 | #include <string.h> | ||
39 | #include <stdlib.h> | ||
40 | #include <regex.h> | ||
38 | #include <sys/types.h> | 41 | #include <sys/types.h> |
39 | 42 | ||
40 | #include <regex.h> | ||
41 | 43 | ||
42 | /* The kinds of value we can have. */ | 44 | /* The kinds of value we can have. */ |
43 | enum valtype { | 45 | enum valtype { |
diff --git a/coreutils/head.c b/coreutils/head.c index a0ca453de..71aa8258c 100644 --- a/coreutils/head.c +++ b/coreutils/head.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <getopt.h> | ||
29 | #include <stdlib.h> | ||
28 | 30 | ||
29 | int head(int len, FILE *fp) | 31 | int head(int len, FILE *fp) |
30 | { | 32 | { |
diff --git a/coreutils/hostid.c b/coreutils/hostid.c index 35a5859c4..eed1a50ec 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c | |||
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <unistd.h> | ||
25 | 27 | ||
26 | extern int hostid_main(int argc, char **argv) | 28 | extern int hostid_main(int argc, char **argv) |
27 | { | 29 | { |
diff --git a/coreutils/id.c b/coreutils/id.c index d50de4775..e91ac7585 100644 --- a/coreutils/id.c +++ b/coreutils/id.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <unistd.h> | 25 | #include <unistd.h> |
26 | #include <getopt.h> | 26 | #include <getopt.h> |
27 | #include <string.h> | ||
27 | #include <sys/types.h> | 28 | #include <sys/types.h> |
28 | 29 | ||
29 | extern int id_main(int argc, char **argv) | 30 | extern int id_main(int argc, char **argv) |
diff --git a/coreutils/ln.c b/coreutils/ln.c index e69cb024a..d6bf6443a 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c | |||
@@ -28,7 +28,10 @@ | |||
28 | 28 | ||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <dirent.h> | 30 | #include <dirent.h> |
31 | #include <string.h> | ||
32 | #include <stdlib.h> | ||
31 | #include <errno.h> | 33 | #include <errno.h> |
34 | #include <unistd.h> | ||
32 | 35 | ||
33 | static const int LN_SYMLINK = 1; | 36 | static const int LN_SYMLINK = 1; |
34 | static const int LN_FORCE = 2; | 37 | static const int LN_FORCE = 2; |
diff --git a/coreutils/logname.c b/coreutils/logname.c index d614e85f1..edec016e6 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c | |||
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <unistd.h> | ||
25 | 27 | ||
26 | extern int logname_main(int argc, char **argv) | 28 | extern int logname_main(int argc, char **argv) |
27 | { | 29 | { |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 4b225d6f8..affa48c12 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -59,6 +59,7 @@ static const int COLUMN_GAP = 2; /* includes the file type char, if present */ | |||
59 | #include <time.h> | 59 | #include <time.h> |
60 | #endif | 60 | #endif |
61 | #include <string.h> | 61 | #include <string.h> |
62 | #include <stdlib.h> | ||
62 | 63 | ||
63 | #include <fcntl.h> | 64 | #include <fcntl.h> |
64 | #include <signal.h> | 65 | #include <signal.h> |
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 92357a665..eb6e7db7d 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c | |||
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <string.h> | ||
32 | #include <stdlib.h> | ||
31 | 33 | ||
32 | static int parentFlag = FALSE; | 34 | static int parentFlag = FALSE; |
33 | static mode_t mode = 0777; | 35 | static mode_t mode = 0777; |
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index 728e1ec2f..b31e6f172 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdlib.h> | ||
27 | 28 | ||
28 | extern int mkfifo_main(int argc, char **argv) | 29 | extern int mkfifo_main(int argc, char **argv) |
29 | { | 30 | { |
diff --git a/coreutils/mknod.c b/coreutils/mknod.c index 4d8c598ea..c761aea6f 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <sys/types.h> | 26 | #include <sys/types.h> |
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <string.h> | ||
30 | #include <stdlib.h> | ||
29 | 31 | ||
30 | int mknod_main(int argc, char **argv) | 32 | int mknod_main(int argc, char **argv) |
31 | { | 33 | { |
diff --git a/coreutils/pwd.c b/coreutils/pwd.c index da089f37c..a9acbc721 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <dirent.h> | 26 | #include <dirent.h> |
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | #include <unistd.h> | ||
29 | #include <stdlib.h> | ||
28 | 30 | ||
29 | extern int pwd_main(int argc, char **argv) | 31 | extern int pwd_main(int argc, char **argv) |
30 | { | 32 | { |
diff --git a/coreutils/rm.c b/coreutils/rm.c index a9501ec7f..302599ec0 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <utime.h> | 28 | #include <utime.h> |
29 | #include <dirent.h> | 29 | #include <dirent.h> |
30 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <unistd.h> | ||
32 | #include <stdlib.h> | ||
31 | 33 | ||
32 | static int recursiveFlag = FALSE; | 34 | static int recursiveFlag = FALSE; |
33 | static int forceFlag = FALSE; | 35 | static int forceFlag = FALSE; |
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index f9f82bba4..8c2165e6b 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | #include <unistd.h> | ||
29 | #include <stdlib.h> | ||
28 | 30 | ||
29 | extern int rmdir_main(int argc, char **argv) | 31 | extern int rmdir_main(int argc, char **argv) |
30 | { | 32 | { |
diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 10eca593e..61b7ce404 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c | |||
@@ -23,6 +23,8 @@ | |||
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <unistd.h> | ||
27 | #include <stdlib.h> | ||
26 | 28 | ||
27 | extern int sleep_main(int argc, char **argv) | 29 | extern int sleep_main(int argc, char **argv) |
28 | { | 30 | { |
diff --git a/coreutils/sort.c b/coreutils/sort.c index efff6b653..2aef2d955 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
@@ -22,6 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <getopt.h> | ||
26 | #include <stdlib.h> | ||
25 | 27 | ||
26 | int compare_ascii(const void *x, const void *y) | 28 | int compare_ascii(const void *x, const void *y) |
27 | { | 29 | { |
diff --git a/coreutils/sync.c b/coreutils/sync.c index 8f101cf17..f95c24c6c 100644 --- a/coreutils/sync.c +++ b/coreutils/sync.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <unistd.h> | ||
26 | 27 | ||
27 | extern int sync_main(int argc, char **argv) | 28 | extern int sync_main(int argc, char **argv) |
28 | { | 29 | { |
diff --git a/coreutils/tail.c b/coreutils/tail.c index dc5918d6b..40511aa7b 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
@@ -23,8 +23,12 @@ | |||
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | 25 | ||
26 | #include <sys/types.h> | ||
27 | #include <fcntl.h> | 26 | #include <fcntl.h> |
27 | #include <getopt.h> | ||
28 | #include <string.h> | ||
29 | #include <stdlib.h> | ||
30 | #include <unistd.h> | ||
31 | #include <sys/types.h> | ||
28 | 32 | ||
29 | static struct suffix_mult tail_suffixes[] = { | 33 | static struct suffix_mult tail_suffixes[] = { |
30 | { "b", 512 }, | 34 | { "b", 512 }, |
diff --git a/coreutils/touch.c b/coreutils/touch.c index 1b03075e8..fa2f3b609 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <fcntl.h> | 28 | #include <fcntl.h> |
29 | #include <utime.h> | 29 | #include <utime.h> |
30 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <unistd.h> | ||
32 | #include <stdlib.h> | ||
31 | 33 | ||
32 | extern int touch_main(int argc, char **argv) | 34 | extern int touch_main(int argc, char **argv) |
33 | { | 35 | { |
diff --git a/coreutils/tr.c b/coreutils/tr.c index 15e3709bb..2717a92db 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
@@ -191,9 +191,9 @@ extern int tr_main(int argc, char **argv) | |||
191 | map(input, input_length, output, output_length); | 191 | map(input, input_length, output, output_length); |
192 | } | 192 | } |
193 | for (i = 0; i < input_length; i++) | 193 | for (i = 0; i < input_length; i++) |
194 | invec[input[i]] = TRUE; | 194 | invec[(int)input[i]] = TRUE; |
195 | for (i = 0; i < output_length; i++) | 195 | for (i = 0; i < output_length; i++) |
196 | outvec[output[i]] = TRUE; | 196 | outvec[(int)output[i]] = TRUE; |
197 | } | 197 | } |
198 | convert(); | 198 | convert(); |
199 | return (0); | 199 | return (0); |
diff --git a/coreutils/tty.c b/coreutils/tty.c index 46201d3e6..2a64b149d 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c | |||
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <unistd.h> | ||
25 | #include <sys/types.h> | 27 | #include <sys/types.h> |
26 | 28 | ||
27 | extern int tty_main(int argc, char **argv) | 29 | extern int tty_main(int argc, char **argv) |
diff --git a/coreutils/uname.c b/coreutils/uname.c index 4f7c643f9..deaffd700 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include "busybox.h" | 34 | #include "busybox.h" |
35 | #include <stdio.h> | 35 | #include <stdio.h> |
36 | #include <stdlib.h> | ||
36 | #include <sys/types.h> | 37 | #include <sys/types.h> |
37 | #include <sys/utsname.h> | 38 | #include <sys/utsname.h> |
38 | 39 | ||
diff --git a/coreutils/uniq.c b/coreutils/uniq.c index c0229aecb..228855962 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c | |||
@@ -26,7 +26,9 @@ | |||
26 | #include "busybox.h" | 26 | #include "busybox.h" |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <string.h> | 28 | #include <string.h> |
29 | #include <getopt.h> | ||
29 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <stdlib.h> | ||
30 | 32 | ||
31 | static int print_count; | 33 | static int print_count; |
32 | static int print_uniq = 1; | 34 | static int print_uniq = 1; |
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 7b26d2dad..fcfcfd903 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -27,6 +27,10 @@ | |||
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <getopt.h> | 29 | #include <getopt.h> |
30 | #include <string.h> | ||
31 | #include <stdlib.h> | ||
32 | #include "pwd_grp/pwd.h" | ||
33 | #include "pwd_grp/grp.h" | ||
30 | 34 | ||
31 | /*struct passwd *getpwnam();*/ | 35 | /*struct passwd *getpwnam();*/ |
32 | 36 | ||
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 24aabd373..5df49026b 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <getopt.h> | 29 | #include <getopt.h> |
30 | #include <stdlib.h> | ||
30 | 31 | ||
31 | #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) | 32 | #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
32 | 33 | ||
diff --git a/coreutils/wc.c b/coreutils/wc.c index e6f753435..619c161a7 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <getopt.h> | 25 | #include <getopt.h> |
26 | #include <stdlib.h> | ||
26 | 27 | ||
27 | static int total_lines, total_words, total_chars, max_length; | 28 | static int total_lines, total_words, total_chars, max_length; |
28 | static int print_lines, print_words, print_chars, print_length; | 29 | static int print_lines, print_words, print_chars, print_length; |
diff --git a/coreutils/whoami.c b/coreutils/whoami.c index d7f0a177c..870ede43e 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c | |||
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <unistd.h> | ||
25 | 27 | ||
26 | extern int whoami_main(int argc, char **argv) | 28 | extern int whoami_main(int argc, char **argv) |
27 | { | 29 | { |
diff --git a/coreutils/yes.c b/coreutils/yes.c index 46873f3f9..0ce49499f 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
25 | 26 | ||
26 | extern int yes_main(int argc, char **argv) | 27 | extern int yes_main(int argc, char **argv) |
27 | { | 28 | { |
@@ -42,6 +42,7 @@ | |||
42 | #include <unistd.h> | 42 | #include <unistd.h> |
43 | #include <errno.h> | 43 | #include <errno.h> |
44 | #include <getopt.h> | 44 | #include <getopt.h> |
45 | #include <stdlib.h> | ||
45 | 46 | ||
46 | static const int is_cp = 0; | 47 | static const int is_cp = 0; |
47 | static const int is_mv = 1; | 48 | static const int is_mv = 1; |
@@ -31,6 +31,7 @@ | |||
31 | #include <unistd.h> | 31 | #include <unistd.h> |
32 | #include <time.h> | 32 | #include <time.h> |
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | #include <string.h> | ||
34 | #include <getopt.h> | 35 | #include <getopt.h> |
35 | 36 | ||
36 | 37 | ||
@@ -24,6 +24,10 @@ | |||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | 25 | ||
26 | #include <sys/types.h> | 26 | #include <sys/types.h> |
27 | #include <stdlib.h> | ||
28 | #include <stdio.h> | ||
29 | #include <unistd.h> | ||
30 | #include <string.h> | ||
27 | #include <fcntl.h> | 31 | #include <fcntl.h> |
28 | 32 | ||
29 | static struct suffix_mult dd_suffixes[] = { | 33 | static struct suffix_mult dd_suffixes[] = { |
@@ -24,8 +24,10 @@ | |||
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <stdlib.h> | ||
27 | #include <mntent.h> | 28 | #include <mntent.h> |
28 | #include <sys/vfs.h> | 29 | #include <sys/vfs.h> |
30 | #include <getopt.h> | ||
29 | 31 | ||
30 | extern const char mtab_file[]; /* Defined in utility.c */ | 32 | extern const char mtab_file[]; /* Defined in utility.c */ |
31 | #ifdef BB_FEATURE_HUMAN_READABLE | 33 | #ifdef BB_FEATURE_HUMAN_READABLE |
@@ -22,6 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <string.h> | ||
25 | 27 | ||
26 | extern int dirname_main(int argc, char **argv) | 28 | extern int dirname_main(int argc, char **argv) |
27 | { | 29 | { |
@@ -18,9 +18,11 @@ | |||
18 | #include "busybox.h" | 18 | #include "busybox.h" |
19 | #include <stdio.h> | 19 | #include <stdio.h> |
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include <getopt.h> | ||
21 | 22 | ||
22 | #if __GNU_LIBRARY__ < 5 | 23 | #if __GNU_LIBRARY__ < 5 |
23 | 24 | #include <sys/syscall.h> | |
25 | #include <linux/unistd.h> | ||
24 | #ifndef __alpha__ | 26 | #ifndef __alpha__ |
25 | # define __NR_klogctl __NR_syslog | 27 | # define __NR_klogctl __NR_syslog |
26 | static inline _syscall3(int, klogctl, int, type, char *, b, int, len); | 28 | static inline _syscall3(int, klogctl, int, type, char *, b, int, len); |
diff --git a/dpkg_deb.c b/dpkg_deb.c index 35904950f..3a789379b 100644 --- a/dpkg_deb.c +++ b/dpkg_deb.c | |||
@@ -17,6 +17,9 @@ | |||
17 | #include <stdio.h> | 17 | #include <stdio.h> |
18 | #include <stdlib.h> | 18 | #include <stdlib.h> |
19 | #include <fcntl.h> | 19 | #include <fcntl.h> |
20 | #include <unistd.h> | ||
21 | #include <string.h> | ||
22 | #include <stdlib.h> | ||
20 | #include "busybox.h" | 23 | #include "busybox.h" |
21 | 24 | ||
22 | typedef struct ar_headers_s { | 25 | typedef struct ar_headers_s { |
@@ -31,6 +31,8 @@ | |||
31 | #include <fcntl.h> | 31 | #include <fcntl.h> |
32 | #include <dirent.h> | 32 | #include <dirent.h> |
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | #include <stdlib.h> | ||
35 | #include <getopt.h> | ||
34 | #include <errno.h> | 36 | #include <errno.h> |
35 | 37 | ||
36 | #ifdef BB_FEATURE_HUMAN_READABLE | 38 | #ifdef BB_FEATURE_HUMAN_READABLE |
@@ -185,7 +187,7 @@ int du_main(int argc, char **argv) | |||
185 | return status; | 187 | return status; |
186 | } | 188 | } |
187 | 189 | ||
188 | /* $Id: du.c,v 1.34 2001/01/22 22:35:38 rjune Exp $ */ | 190 | /* $Id: du.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ */ |
189 | /* | 191 | /* |
190 | Local Variables: | 192 | Local Variables: |
191 | c-file-style: "linux" | 193 | c-file-style: "linux" |
diff --git a/dumpkmap.c b/dumpkmap.c index b438ba271..b2067b30c 100644 --- a/dumpkmap.c +++ b/dumpkmap.c | |||
@@ -24,6 +24,9 @@ | |||
24 | #include <errno.h> | 24 | #include <errno.h> |
25 | #include <fcntl.h> | 25 | #include <fcntl.h> |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <unistd.h> | ||
28 | #include <string.h> | ||
29 | #include <stdlib.h> | ||
27 | #include <sys/ioctl.h> | 30 | #include <sys/ioctl.h> |
28 | 31 | ||
29 | /* From <linux/kd.h> */ | 32 | /* From <linux/kd.h> */ |
@@ -21,6 +21,8 @@ | |||
21 | #define bb_need_io_error | 21 | #define bb_need_io_error |
22 | #include "messages.c" | 22 | #include "messages.c" |
23 | #include <utmp.h> | 23 | #include <utmp.h> |
24 | #include <stdlib.h> | ||
25 | #include <unistd.h> | ||
24 | 26 | ||
25 | extern int dutmp_main(int argc, char **argv) | 27 | extern int dutmp_main(int argc, char **argv) |
26 | { | 28 | { |
@@ -35,7 +37,7 @@ extern int dutmp_main(int argc, char **argv) | |||
35 | } else { | 37 | } else { |
36 | file = open(argv[1], O_RDONLY); | 38 | file = open(argv[1], O_RDONLY); |
37 | if (file < 0) { | 39 | if (file < 0) { |
38 | error_msg_and_die(io_error, argv[1], strerror(errno)); | 40 | perror_msg_and_die(io_error, argv[1]); |
39 | } | 41 | } |
40 | } | 42 | } |
41 | 43 | ||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <string.h> | ||
28 | #include <stdlib.h> | ||
27 | 29 | ||
28 | extern int | 30 | extern int |
29 | echo_main(int argc, char** argv) | 31 | echo_main(int argc, char** argv) |
diff --git a/editors/sed.c b/editors/sed.c index a50d8d03b..95aad79e8 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -47,9 +47,11 @@ | |||
47 | #include <string.h> /* for strdup() */ | 47 | #include <string.h> /* for strdup() */ |
48 | #include <errno.h> | 48 | #include <errno.h> |
49 | #include <ctype.h> /* for isspace() */ | 49 | #include <ctype.h> /* for isspace() */ |
50 | #include <stdlib.h> | ||
50 | #include "busybox.h" | 51 | #include "busybox.h" |
51 | 52 | ||
52 | /* externs */ | 53 | /* externs */ |
54 | extern void xregcomp(regex_t *preg, const char *regex, int cflags); | ||
53 | extern int optind; /* in unistd.h */ | 55 | extern int optind; /* in unistd.h */ |
54 | extern char *optarg; /* ditto */ | 56 | extern char *optarg; /* ditto */ |
55 | 57 | ||
@@ -35,9 +35,11 @@ | |||
35 | 35 | ||
36 | #include "busybox.h" | 36 | #include "busybox.h" |
37 | #include <stdio.h> | 37 | #include <stdio.h> |
38 | #include <string.h> | ||
39 | #include <stdlib.h> | ||
40 | #include <regex.h> | ||
38 | #include <sys/types.h> | 41 | #include <sys/types.h> |
39 | 42 | ||
40 | #include <regex.h> | ||
41 | 43 | ||
42 | /* The kinds of value we can have. */ | 44 | /* The kinds of value we can have. */ |
43 | enum valtype { | 45 | enum valtype { |
@@ -31,6 +31,7 @@ | |||
31 | #include <fcntl.h> | 31 | #include <fcntl.h> |
32 | #include <errno.h> | 32 | #include <errno.h> |
33 | #include <ctype.h> | 33 | #include <ctype.h> |
34 | #include <string.h> | ||
34 | #include <sys/ioctl.h> | 35 | #include <sys/ioctl.h> |
35 | 36 | ||
36 | #define DEFAULTFBDEV "/dev/fb0" | 37 | #define DEFAULTFBDEV "/dev/fb0" |
@@ -25,6 +25,7 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <sys/ioctl.h> | 26 | #include <sys/ioctl.h> |
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <stdlib.h> | ||
28 | 29 | ||
29 | /* From <linux/fd.h> */ | 30 | /* From <linux/fd.h> */ |
30 | #define FDFLUSH _IO(2,0x4b) | 31 | #define FDFLUSH _IO(2,0x4b) |
@@ -26,6 +26,8 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | #include <dirent.h> | 28 | #include <dirent.h> |
29 | #include <string.h> | ||
30 | #include <stdlib.h> | ||
29 | 31 | ||
30 | 32 | ||
31 | static char *pattern = NULL; | 33 | static char *pattern = NULL; |
diff --git a/findutils/find.c b/findutils/find.c index 32d7db7ab..59a5b838d 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | #include <dirent.h> | 28 | #include <dirent.h> |
29 | #include <string.h> | ||
30 | #include <stdlib.h> | ||
29 | 31 | ||
30 | 32 | ||
31 | static char *pattern = NULL; | 33 | static char *pattern = NULL; |
diff --git a/findutils/grep.c b/findutils/grep.c index 0ed9594b0..e9ff91b3e 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include "busybox.h" | 29 | #include "busybox.h" |
30 | 30 | ||
31 | extern void xregcomp(regex_t *preg, const char *regex, int cflags); | ||
32 | |||
31 | extern int optind; /* in unistd.h */ | 33 | extern int optind; /* in unistd.h */ |
32 | extern int errno; /* for use with strerror() */ | 34 | extern int errno; /* for use with strerror() */ |
33 | 35 | ||
diff --git a/findutils/which.c b/findutils/which.c index a92777eb7..b900a0b14 100644 --- a/findutils/which.c +++ b/findutils/which.c | |||
@@ -22,7 +22,9 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <string.h> | ||
25 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <stdlib.h> | ||
26 | 28 | ||
27 | extern int which_main(int argc, char **argv) | 29 | extern int which_main(int argc, char **argv) |
28 | { | 30 | { |
@@ -24,6 +24,7 @@ | |||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdlib.h> | ||
27 | 28 | ||
28 | extern int free_main(int argc, char **argv) | 29 | extern int free_main(int argc, char **argv) |
29 | { | 30 | { |
diff --git a/freeramdisk.c b/freeramdisk.c index a2b17c673..8f90f40b5 100644 --- a/freeramdisk.c +++ b/freeramdisk.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <sys/ioctl.h> | 28 | #include <sys/ioctl.h> |
29 | #include <errno.h> | 29 | #include <errno.h> |
30 | #include <stdlib.h> | ||
30 | #include "busybox.h" | 31 | #include "busybox.h" |
31 | 32 | ||
32 | 33 | ||
@@ -28,6 +28,8 @@ | |||
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include "busybox.h" | 29 | #include "busybox.h" |
30 | 30 | ||
31 | extern void xregcomp(regex_t *preg, const char *regex, int cflags); | ||
32 | |||
31 | extern int optind; /* in unistd.h */ | 33 | extern int optind; /* in unistd.h */ |
32 | extern int errno; /* for use with strerror() */ | 34 | extern int errno; /* for use with strerror() */ |
33 | 35 | ||
@@ -45,6 +45,7 @@ | |||
45 | */ | 45 | */ |
46 | #include <stdio.h> | 46 | #include <stdio.h> |
47 | #include <string.h> | 47 | #include <string.h> |
48 | #include <unistd.h> | ||
48 | #define memzero(s, n) memset ((void *)(s), 0, (n)) | 49 | #define memzero(s, n) memset ((void *)(s), 0, (n)) |
49 | 50 | ||
50 | #ifndef RETSIGTYPE | 51 | #ifndef RETSIGTYPE |
@@ -25,6 +25,8 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <getopt.h> | ||
29 | #include <stdlib.h> | ||
28 | 30 | ||
29 | int head(int len, FILE *fp) | 31 | int head(int len, FILE *fp) |
30 | { | 32 | { |
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <unistd.h> | ||
25 | 27 | ||
26 | extern int hostid_main(int argc, char **argv) | 28 | extern int hostid_main(int argc, char **argv) |
27 | { | 29 | { |
diff --git a/hostname.c b/hostname.c index b1f061369..a789fa0f1 100644 --- a/hostname.c +++ b/hostname.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: hostname.c,v 1.20 2001/01/24 18:44:54 andersen Exp $ | 3 | * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $ |
4 | * Mini hostname implementation for busybox | 4 | * Mini hostname implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -28,6 +28,7 @@ | |||
28 | #include <arpa/inet.h> | 28 | #include <arpa/inet.h> |
29 | #include <netdb.h> | 29 | #include <netdb.h> |
30 | #include <unistd.h> | 30 | #include <unistd.h> |
31 | #include <string.h> | ||
31 | #include <stdio.h> | 32 | #include <stdio.h> |
32 | 33 | ||
33 | void do_sethostname(char *s, int isfile) | 34 | void do_sethostname(char *s, int isfile) |
@@ -24,6 +24,7 @@ | |||
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <unistd.h> | 25 | #include <unistd.h> |
26 | #include <getopt.h> | 26 | #include <getopt.h> |
27 | #include <string.h> | ||
27 | #include <sys/types.h> | 28 | #include <sys/types.h> |
28 | 29 | ||
29 | extern int id_main(int argc, char **argv) | 30 | extern int id_main(int argc, char **argv) |
diff --git a/include/busybox.h b/include/busybox.h index be6c6f305..5f9425a5b 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -26,19 +26,10 @@ | |||
26 | 26 | ||
27 | #include "Config.h" | 27 | #include "Config.h" |
28 | 28 | ||
29 | #include <stdlib.h> | 29 | #include <stdio.h> |
30 | #include <stdarg.h> | 30 | #include <stdarg.h> |
31 | #include <string.h> | ||
32 | #include <unistd.h> | ||
33 | #include <errno.h> | ||
34 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
35 | #include <sys/param.h> | ||
36 | #include <sys/types.h> | 32 | #include <sys/types.h> |
37 | #include <mntent.h> | ||
38 | #include <regex.h> | ||
39 | /* for the _syscall() macros */ | ||
40 | #include <sys/syscall.h> | ||
41 | #include <linux/unistd.h> | ||
42 | 33 | ||
43 | #ifdef DMALLOC | 34 | #ifdef DMALLOC |
44 | #include "dmalloc.h" | 35 | #include "dmalloc.h" |
@@ -69,26 +60,6 @@ static inline int is_octal(ch) { return ((ch >= '0') && (ch <= '7')); } | |||
69 | #endif | 60 | #endif |
70 | 61 | ||
71 | 62 | ||
72 | /* I don't like nested includes, but the string and io functions are used | ||
73 | * too often | ||
74 | */ | ||
75 | #include <stdio.h> | ||
76 | #if !defined(NO_STRING_H) || defined(STDC_HEADERS) | ||
77 | # include <string.h> | ||
78 | # if !defined(STDC_HEADERS) && !defined(NO_MEMORY_H) && !defined(__GNUC__) | ||
79 | # include <memory.h> | ||
80 | # endif | ||
81 | # define memzero(s, n) memset ((void *)(s), 0, (n)) | ||
82 | #else | ||
83 | # include <strings.h> | ||
84 | # define strchr index | ||
85 | # define strrchr rindex | ||
86 | # define memcpy(d, s, n) bcopy((s), (d), (n)) | ||
87 | # define memcmp(s1, s2, n) bcmp((s1), (s2), (n)) | ||
88 | # define memzero(s, n) bzero((s), (n)) | ||
89 | #endif | ||
90 | |||
91 | |||
92 | enum Location { | 63 | enum Location { |
93 | _BB_DIR_ROOT = 0, | 64 | _BB_DIR_ROOT = 0, |
94 | _BB_DIR_BIN, | 65 | _BB_DIR_BIN, |
@@ -179,7 +150,6 @@ extern void print_file(FILE *file); | |||
179 | extern int print_file_by_name(char *filename); | 150 | extern int print_file_by_name(char *filename); |
180 | extern char process_escape_sequence(char **ptr); | 151 | extern char process_escape_sequence(char **ptr); |
181 | extern char *get_last_path_component(char *path); | 152 | extern char *get_last_path_component(char *path); |
182 | extern void xregcomp(regex_t *preg, const char *regex, int cflags); | ||
183 | extern FILE *wfopen(const char *path, const char *mode); | 153 | extern FILE *wfopen(const char *path, const char *mode); |
184 | extern FILE *xfopen(const char *path, const char *mode); | 154 | extern FILE *xfopen(const char *path, const char *mode); |
185 | 155 | ||
diff --git a/include/grp.h b/include/grp.h index f27c466fd..87d4115ce 100644 --- a/include/grp.h +++ b/include/grp.h | |||
@@ -5,16 +5,6 @@ | |||
5 | #include <grp.h> | 5 | #include <grp.h> |
6 | #else | 6 | #else |
7 | 7 | ||
8 | #define bb_setgrent setgrent | ||
9 | #define bb_endgrent endgrent | ||
10 | #define bb_getgrent getgrent | ||
11 | #define bb_getgrgid getgrgid | ||
12 | #define bb_getgrnam getgrnam | ||
13 | #define bb_fgetgrent fgetgrent | ||
14 | #define bb_setgroups setgroups | ||
15 | #define bb_initgroups initgroups | ||
16 | #define __bb_getgrent __getgrent | ||
17 | |||
18 | #include <sys/types.h> | 8 | #include <sys/types.h> |
19 | #include <features.h> | 9 | #include <features.h> |
20 | #include <stdio.h> | 10 | #include <stdio.h> |
@@ -28,19 +18,19 @@ struct group | |||
28 | char **gr_mem; /* Member list. */ | 18 | char **gr_mem; /* Member list. */ |
29 | }; | 19 | }; |
30 | 20 | ||
31 | extern void bb_setgrent __P ((void)); | 21 | extern void setgrent __P ((void)); |
32 | extern void bb_endgrent __P ((void)); | 22 | extern void endgrent __P ((void)); |
33 | extern struct group * bb_getgrent __P ((void)); | 23 | extern struct group * getgrent __P ((void)); |
34 | 24 | ||
35 | extern struct group * bb_getgrgid __P ((__const gid_t gid)); | 25 | extern struct group * getgrgid __P ((__const gid_t gid)); |
36 | extern struct group * bb_getgrnam __P ((__const char * name)); | 26 | extern struct group * getgrnam __P ((__const char * name)); |
37 | 27 | ||
38 | extern struct group * bb_fgetgrent __P ((FILE * file)); | 28 | extern struct group * fgetgrent __P ((FILE * file)); |
39 | 29 | ||
40 | extern int bb_setgroups __P ((size_t n, __const gid_t * groups)); | 30 | extern int setgroups __P ((size_t n, __const gid_t * groups)); |
41 | extern int bb_initgroups __P ((__const char * user, gid_t gid)); | 31 | extern int initgroups __P ((__const char * user, gid_t gid)); |
42 | 32 | ||
43 | extern struct group * __bb_getgrent __P ((int grp_fd)); | 33 | extern struct group * __getgrent __P ((int grp_fd)); |
44 | 34 | ||
45 | #endif /* USE_SYSTEM_PWD_GRP */ | 35 | #endif /* USE_SYSTEM_PWD_GRP */ |
46 | #endif /* __BB_GRP_H */ | 36 | #endif /* __BB_GRP_H */ |
diff --git a/include/pwd.h b/include/pwd.h index 82743f5ad..e603a96e3 100644 --- a/include/pwd.h +++ b/include/pwd.h | |||
@@ -5,17 +5,6 @@ | |||
5 | #include <pwd.h> | 5 | #include <pwd.h> |
6 | #else | 6 | #else |
7 | 7 | ||
8 | #define bb_setpwent setpwent | ||
9 | #define bb_endpwent endpwent | ||
10 | #define bb_getpwent getpwent | ||
11 | #define bb_putpwent putpwent | ||
12 | #define bb_getpw getpw | ||
13 | #define bb_fgetpwent fgetpwent | ||
14 | #define bb_getpwuid getpwuid | ||
15 | #define bb_getpwnam getpwnam | ||
16 | #define __bb_getpwent __bb_getpwent | ||
17 | |||
18 | |||
19 | #include <sys/types.h> | 8 | #include <sys/types.h> |
20 | #include <features.h> | 9 | #include <features.h> |
21 | #include <stdio.h> | 10 | #include <stdio.h> |
@@ -32,19 +21,19 @@ struct passwd | |||
32 | char *pw_shell; /* Shell program. */ | 21 | char *pw_shell; /* Shell program. */ |
33 | }; | 22 | }; |
34 | 23 | ||
35 | extern void bb_setpwent __P ((void)); | 24 | extern void setpwent __P ((void)); |
36 | extern void bb_endpwent __P ((void)); | 25 | extern void endpwent __P ((void)); |
37 | extern struct passwd * bb_getpwent __P ((void)); | 26 | extern struct passwd * getpwent __P ((void)); |
38 | 27 | ||
39 | extern int bb_putpwent __P ((__const struct passwd * __p, FILE * __f)); | 28 | extern int putpwent __P ((__const struct passwd * __p, FILE * __f)); |
40 | extern int bb_getpw __P ((uid_t uid, char *buf)); | 29 | extern int getpw __P ((uid_t uid, char *buf)); |
41 | 30 | ||
42 | extern struct passwd * bb_fgetpwent __P ((FILE * file)); | 31 | extern struct passwd * fgetpwent __P ((FILE * file)); |
43 | 32 | ||
44 | extern struct passwd * bb_getpwuid __P ((__const uid_t)); | 33 | extern struct passwd * getpwuid __P ((__const uid_t)); |
45 | extern struct passwd * bb_getpwnam __P ((__const char *)); | 34 | extern struct passwd * getpwnam __P ((__const char *)); |
46 | 35 | ||
47 | extern struct passwd * __bb_getpwent __P ((__const int passwd_fd)); | 36 | extern struct passwd * __getpwent __P ((__const int passwd_fd)); |
48 | 37 | ||
49 | #endif /* USE_SYSTEM_PWD_GRP */ | 38 | #endif /* USE_SYSTEM_PWD_GRP */ |
50 | #endif /* __BB_PWD_H */ | 39 | #endif /* __BB_PWD_H */ |
@@ -37,6 +37,7 @@ | |||
37 | #include <string.h> | 37 | #include <string.h> |
38 | #include <termios.h> | 38 | #include <termios.h> |
39 | #include <unistd.h> | 39 | #include <unistd.h> |
40 | #include <limits.h> | ||
40 | #include <sys/fcntl.h> | 41 | #include <sys/fcntl.h> |
41 | #include <sys/ioctl.h> | 42 | #include <sys/ioctl.h> |
42 | #include <sys/mount.h> | 43 | #include <sys/mount.h> |
@@ -114,6 +115,8 @@ static const int RB_AUTOBOOT = 0x01234567; | |||
114 | #if defined(__GLIBC__) | 115 | #if defined(__GLIBC__) |
115 | #include <sys/kdaemon.h> | 116 | #include <sys/kdaemon.h> |
116 | #else | 117 | #else |
118 | #include <sys/syscall.h> | ||
119 | #include <linux/unistd.h> | ||
117 | static _syscall2(int, bdflush, int, func, int, data); | 120 | static _syscall2(int, bdflush, int, func, int, data); |
118 | #endif /* __GLIBC__ */ | 121 | #endif /* __GLIBC__ */ |
119 | 122 | ||
diff --git a/init/init.c b/init/init.c index 86906487f..5d0d924ad 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <string.h> | 37 | #include <string.h> |
38 | #include <termios.h> | 38 | #include <termios.h> |
39 | #include <unistd.h> | 39 | #include <unistd.h> |
40 | #include <limits.h> | ||
40 | #include <sys/fcntl.h> | 41 | #include <sys/fcntl.h> |
41 | #include <sys/ioctl.h> | 42 | #include <sys/ioctl.h> |
42 | #include <sys/mount.h> | 43 | #include <sys/mount.h> |
@@ -114,6 +115,8 @@ static const int RB_AUTOBOOT = 0x01234567; | |||
114 | #if defined(__GLIBC__) | 115 | #if defined(__GLIBC__) |
115 | #include <sys/kdaemon.h> | 116 | #include <sys/kdaemon.h> |
116 | #else | 117 | #else |
118 | #include <sys/syscall.h> | ||
119 | #include <linux/unistd.h> | ||
117 | static _syscall2(int, bdflush, int, func, int, data); | 120 | static _syscall2(int, bdflush, int, func, int, data); |
118 | #endif /* __GLIBC__ */ | 121 | #endif /* __GLIBC__ */ |
119 | 122 | ||
@@ -46,8 +46,11 @@ | |||
46 | #include <dirent.h> | 46 | #include <dirent.h> |
47 | #include <ctype.h> | 47 | #include <ctype.h> |
48 | #include <assert.h> | 48 | #include <assert.h> |
49 | #include <string.h> | ||
49 | #include <getopt.h> | 50 | #include <getopt.h> |
50 | #include <sys/utsname.h> | 51 | #include <sys/utsname.h> |
52 | #include <sys/syscall.h> | ||
53 | #include <linux/unistd.h> | ||
51 | 54 | ||
52 | //---------------------------------------------------------------------------- | 55 | //---------------------------------------------------------------------------- |
53 | //--------modutils module.h, lines 45-242 | 56 | //--------modutils module.h, lines 45-242 |
@@ -78,7 +81,7 @@ | |||
78 | #ifndef MODUTILS_MODULE_H | 81 | #ifndef MODUTILS_MODULE_H |
79 | static const int MODUTILS_MODULE_H = 1; | 82 | static const int MODUTILS_MODULE_H = 1; |
80 | 83 | ||
81 | #ident "$Id: insmod.c,v 1.42 2001/01/26 02:23:57 andersen Exp $" | 84 | #ident "$Id: insmod.c,v 1.43 2001/01/27 08:24:37 andersen Exp $" |
82 | 85 | ||
83 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 86 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
84 | We do not use the kernel headers directly because we do not wish | 87 | We do not use the kernel headers directly because we do not wish |
@@ -284,7 +287,7 @@ int delete_module(const char *); | |||
284 | #ifndef MODUTILS_OBJ_H | 287 | #ifndef MODUTILS_OBJ_H |
285 | static const int MODUTILS_OBJ_H = 1; | 288 | static const int MODUTILS_OBJ_H = 1; |
286 | 289 | ||
287 | #ident "$Id: insmod.c,v 1.42 2001/01/26 02:23:57 andersen Exp $" | 290 | #ident "$Id: insmod.c,v 1.43 2001/01/27 08:24:37 andersen Exp $" |
288 | 291 | ||
289 | /* The relocatable object is manipulated using elfin types. */ | 292 | /* The relocatable object is manipulated using elfin types. */ |
290 | 293 | ||
@@ -28,6 +28,7 @@ | |||
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <signal.h> | 29 | #include <signal.h> |
30 | #include <ctype.h> | 30 | #include <ctype.h> |
31 | #include <string.h> | ||
31 | #include <unistd.h> | 32 | #include <unistd.h> |
32 | 33 | ||
33 | static const int KILL = 0; | 34 | static const int KILL = 0; |
@@ -28,7 +28,10 @@ | |||
28 | 28 | ||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <dirent.h> | 30 | #include <dirent.h> |
31 | #include <string.h> | ||
32 | #include <stdlib.h> | ||
31 | #include <errno.h> | 33 | #include <errno.h> |
34 | #include <unistd.h> | ||
32 | 35 | ||
33 | static const int LN_SYMLINK = 1; | 36 | static const int LN_SYMLINK = 1; |
34 | static const int LN_FORCE = 2; | 37 | static const int LN_FORCE = 2; |
diff --git a/loadkmap.c b/loadkmap.c index 43c1cc795..75b40da9a 100644 --- a/loadkmap.c +++ b/loadkmap.c | |||
@@ -24,6 +24,9 @@ | |||
24 | #include <errno.h> | 24 | #include <errno.h> |
25 | #include <fcntl.h> | 25 | #include <fcntl.h> |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <string.h> | ||
28 | #include <stdlib.h> | ||
29 | #include <unistd.h> | ||
27 | #include <sys/ioctl.h> | 30 | #include <sys/ioctl.h> |
28 | 31 | ||
29 | #define BINARY_KEYMAP_MAGIC "bkeymap" | 32 | #define BINARY_KEYMAP_MAGIC "bkeymap" |
@@ -27,6 +27,8 @@ | |||
27 | #include <sys/types.h> | 27 | #include <sys/types.h> |
28 | #include <fcntl.h> | 28 | #include <fcntl.h> |
29 | #include <ctype.h> | 29 | #include <ctype.h> |
30 | #include <string.h> | ||
31 | #include <stdlib.h> | ||
30 | 32 | ||
31 | #if !defined BB_SYSLOGD | 33 | #if !defined BB_SYSLOGD |
32 | 34 | ||
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <unistd.h> | ||
25 | 27 | ||
26 | extern int logname_main(int argc, char **argv) | 28 | extern int logname_main(int argc, char **argv) |
27 | { | 29 | { |
@@ -59,6 +59,7 @@ static const int COLUMN_GAP = 2; /* includes the file type char, if present */ | |||
59 | #include <time.h> | 59 | #include <time.h> |
60 | #endif | 60 | #endif |
61 | #include <string.h> | 61 | #include <string.h> |
62 | #include <stdlib.h> | ||
62 | 63 | ||
63 | #include <fcntl.h> | 64 | #include <fcntl.h> |
64 | #include <signal.h> | 65 | #include <signal.h> |
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c index efd15dfbf..7e1d2eed7 100644 --- a/miscutils/dutmp.c +++ b/miscutils/dutmp.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #define bb_need_io_error | 21 | #define bb_need_io_error |
22 | #include "messages.c" | 22 | #include "messages.c" |
23 | #include <utmp.h> | 23 | #include <utmp.h> |
24 | #include <stdlib.h> | ||
25 | #include <unistd.h> | ||
24 | 26 | ||
25 | extern int dutmp_main(int argc, char **argv) | 27 | extern int dutmp_main(int argc, char **argv) |
26 | { | 28 | { |
@@ -35,7 +37,7 @@ extern int dutmp_main(int argc, char **argv) | |||
35 | } else { | 37 | } else { |
36 | file = open(argv[1], O_RDONLY); | 38 | file = open(argv[1], O_RDONLY); |
37 | if (file < 0) { | 39 | if (file < 0) { |
38 | error_msg_and_die(io_error, argv[1], strerror(errno)); | 40 | perror_msg_and_die(io_error, argv[1]); |
39 | } | 41 | } |
40 | } | 42 | } |
41 | 43 | ||
diff --git a/miscutils/mktemp.c b/miscutils/mktemp.c index 2d53cc2a4..3b9f2b22c 100644 --- a/miscutils/mktemp.c +++ b/miscutils/mktemp.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | #include <unistd.h> | ||
29 | #include <stdlib.h> | ||
28 | 30 | ||
29 | extern int mktemp_main(int argc, char **argv) | 31 | extern int mktemp_main(int argc, char **argv) |
30 | { | 32 | { |
diff --git a/miscutils/mt.c b/miscutils/mt.c index 70d03cca4..0d28339b9 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | #include "busybox.h" | 2 | #include "busybox.h" |
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <stdlib.h> | ||
4 | #include <sys/mtio.h> | 5 | #include <sys/mtio.h> |
5 | #include <sys/fcntl.h> | 6 | #include <sys/fcntl.h> |
6 | 7 | ||
diff --git a/miscutils/readlink.c b/miscutils/readlink.c index bb2056a25..98f1dea4f 100644 --- a/miscutils/readlink.c +++ b/miscutils/readlink.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | #include <stdlib.h> | ||
28 | 29 | ||
29 | int readlink_main(int argc, char **argv) | 30 | int readlink_main(int argc, char **argv) |
30 | { | 31 | { |
diff --git a/miscutils/update.c b/miscutils/update.c index 080cb99c3..309ce0cbd 100644 --- a/miscutils/update.c +++ b/miscutils/update.c | |||
@@ -32,11 +32,14 @@ | |||
32 | #include <sys/param.h> | 32 | #include <sys/param.h> |
33 | #include <sys/syslog.h> | 33 | #include <sys/syslog.h> |
34 | #include <unistd.h> /* for getopt() */ | 34 | #include <unistd.h> /* for getopt() */ |
35 | #include <stdlib.h> | ||
35 | 36 | ||
36 | 37 | ||
37 | #if defined(__GLIBC__) | 38 | #if defined(__GLIBC__) |
38 | #include <sys/kdaemon.h> | 39 | #include <sys/kdaemon.h> |
39 | #else | 40 | #else |
41 | #include <sys/syscall.h> | ||
42 | #include <linux/unistd.h> | ||
40 | static _syscall2(int, bdflush, int, func, int, data); | 43 | static _syscall2(int, bdflush, int, func, int, data); |
41 | #endif /* __GLIBC__ */ | 44 | #endif /* __GLIBC__ */ |
42 | 45 | ||
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index d297afa02..7026cc005 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <fcntl.h> | 25 | #include <fcntl.h> |
26 | #include <unistd.h> | ||
27 | #include <stdlib.h> | ||
26 | 28 | ||
27 | extern int watchdog_main(int argc, char **argv) | 29 | extern int watchdog_main(int argc, char **argv) |
28 | { | 30 | { |
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <string.h> | ||
32 | #include <stdlib.h> | ||
31 | 33 | ||
32 | static int parentFlag = FALSE; | 34 | static int parentFlag = FALSE; |
33 | static mode_t mode = 0777; | 35 | static mode_t mode = 0777; |
@@ -24,6 +24,7 @@ | |||
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdlib.h> | ||
27 | 28 | ||
28 | extern int mkfifo_main(int argc, char **argv) | 29 | extern int mkfifo_main(int argc, char **argv) |
29 | { | 30 | { |
@@ -26,6 +26,8 @@ | |||
26 | #include <sys/types.h> | 26 | #include <sys/types.h> |
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <string.h> | ||
30 | #include <stdlib.h> | ||
29 | 31 | ||
30 | int mknod_main(int argc, char **argv) | 32 | int mknod_main(int argc, char **argv) |
31 | { | 33 | { |
@@ -25,6 +25,8 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | #include <unistd.h> | ||
29 | #include <stdlib.h> | ||
28 | 30 | ||
29 | extern int mktemp_main(int argc, char **argv) | 31 | extern int mktemp_main(int argc, char **argv) |
30 | { | 32 | { |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 6ac2dcda4..b82728a26 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -46,8 +46,11 @@ | |||
46 | #include <dirent.h> | 46 | #include <dirent.h> |
47 | #include <ctype.h> | 47 | #include <ctype.h> |
48 | #include <assert.h> | 48 | #include <assert.h> |
49 | #include <string.h> | ||
49 | #include <getopt.h> | 50 | #include <getopt.h> |
50 | #include <sys/utsname.h> | 51 | #include <sys/utsname.h> |
52 | #include <sys/syscall.h> | ||
53 | #include <linux/unistd.h> | ||
51 | 54 | ||
52 | //---------------------------------------------------------------------------- | 55 | //---------------------------------------------------------------------------- |
53 | //--------modutils module.h, lines 45-242 | 56 | //--------modutils module.h, lines 45-242 |
@@ -78,7 +81,7 @@ | |||
78 | #ifndef MODUTILS_MODULE_H | 81 | #ifndef MODUTILS_MODULE_H |
79 | static const int MODUTILS_MODULE_H = 1; | 82 | static const int MODUTILS_MODULE_H = 1; |
80 | 83 | ||
81 | #ident "$Id: insmod.c,v 1.42 2001/01/26 02:23:57 andersen Exp $" | 84 | #ident "$Id: insmod.c,v 1.43 2001/01/27 08:24:37 andersen Exp $" |
82 | 85 | ||
83 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 86 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
84 | We do not use the kernel headers directly because we do not wish | 87 | We do not use the kernel headers directly because we do not wish |
@@ -284,7 +287,7 @@ int delete_module(const char *); | |||
284 | #ifndef MODUTILS_OBJ_H | 287 | #ifndef MODUTILS_OBJ_H |
285 | static const int MODUTILS_OBJ_H = 1; | 288 | static const int MODUTILS_OBJ_H = 1; |
286 | 289 | ||
287 | #ident "$Id: insmod.c,v 1.42 2001/01/26 02:23:57 andersen Exp $" | 290 | #ident "$Id: insmod.c,v 1.43 2001/01/27 08:24:37 andersen Exp $" |
288 | 291 | ||
289 | /* The relocatable object is manipulated using elfin types. */ | 292 | /* The relocatable object is manipulated using elfin types. */ |
290 | 293 | ||
diff --git a/modutils/rmmod.c b/modutils/rmmod.c index 52adc7bcd..ff08c4ca0 100644 --- a/modutils/rmmod.c +++ b/modutils/rmmod.c | |||
@@ -25,6 +25,9 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | #include <stdlib.h> | ||
29 | #include <sys/syscall.h> | ||
30 | #include <linux/unistd.h> | ||
28 | #define __LIBRARY__ | 31 | #define __LIBRARY__ |
29 | 32 | ||
30 | 33 | ||
@@ -29,6 +29,7 @@ | |||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <fcntl.h> | 30 | #include <fcntl.h> |
31 | #include <signal.h> | 31 | #include <signal.h> |
32 | #include <stdlib.h> | ||
32 | #include <sys/ioctl.h> | 33 | #include <sys/ioctl.h> |
33 | #define BB_DECLARE_EXTERN | 34 | #define BB_DECLARE_EXTERN |
34 | #define bb_need_help | 35 | #define bb_need_help |
@@ -1,6 +1,7 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | #include "busybox.h" | 2 | #include "busybox.h" |
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <stdlib.h> | ||
4 | #include <sys/mtio.h> | 5 | #include <sys/mtio.h> |
5 | #include <sys/fcntl.h> | 6 | #include <sys/fcntl.h> |
6 | 7 | ||
diff --git a/networking/hostname.c b/networking/hostname.c index b1f061369..a789fa0f1 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: hostname.c,v 1.20 2001/01/24 18:44:54 andersen Exp $ | 3 | * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $ |
4 | * Mini hostname implementation for busybox | 4 | * Mini hostname implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -28,6 +28,7 @@ | |||
28 | #include <arpa/inet.h> | 28 | #include <arpa/inet.h> |
29 | #include <netdb.h> | 29 | #include <netdb.h> |
30 | #include <unistd.h> | 30 | #include <unistd.h> |
31 | #include <string.h> | ||
31 | #include <stdio.h> | 32 | #include <stdio.h> |
32 | 33 | ||
33 | void do_sethostname(char *s, int isfile) | 34 | void do_sethostname(char *s, int isfile) |
diff --git a/networking/nslookup.c b/networking/nslookup.c index 271518f22..1f37e313f 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <string.h> | 28 | #include <string.h> |
29 | #include <stdlib.h> | ||
29 | 30 | ||
30 | #include <netdb.h> | 31 | #include <netdb.h> |
31 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
@@ -169,4 +170,4 @@ int nslookup_main(int argc, char **argv) | |||
169 | return EXIT_SUCCESS; | 170 | return EXIT_SUCCESS; |
170 | } | 171 | } |
171 | 172 | ||
172 | /* $Id: nslookup.c,v 1.18 2001/01/24 18:44:54 andersen Exp $ */ | 173 | /* $Id: nslookup.c,v 1.19 2001/01/27 08:24:37 andersen Exp $ */ |
diff --git a/networking/ping.c b/networking/ping.c index 37ca26f31..a2e916362 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.34 2001/01/24 18:44:54 andersen Exp $ | 3 | * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -47,6 +47,9 @@ | |||
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | #include <errno.h> | 49 | #include <errno.h> |
50 | #include <unistd.h> | ||
51 | #include <string.h> | ||
52 | #include <stdlib.h> | ||
50 | 53 | ||
51 | 54 | ||
52 | /* It turns out that libc5 doesn't have proper icmp support | 55 | /* It turns out that libc5 doesn't have proper icmp support |
diff --git a/networking/wget.c b/networking/wget.c index 2c38cb08e..438ecba2e 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -33,6 +33,18 @@ | |||
33 | #include <arpa/inet.h> | 33 | #include <arpa/inet.h> |
34 | #include <netdb.h> | 34 | #include <netdb.h> |
35 | 35 | ||
36 | /* Stupid libc5 doesn't define this... */ | ||
37 | #ifndef timersub | ||
38 | #define timersub(a, b, result) \ | ||
39 | do { \ | ||
40 | (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ | ||
41 | (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ | ||
42 | if ((result)->tv_usec < 0) { \ | ||
43 | --(result)->tv_sec; \ | ||
44 | (result)->tv_usec += 1000000; \ | ||
45 | } \ | ||
46 | } while (0) | ||
47 | #endif | ||
36 | 48 | ||
37 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); | 49 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); |
38 | FILE *open_socket(char *host, int port); | 50 | FILE *open_socket(char *host, int port); |
@@ -283,7 +295,7 @@ FILE *open_socket(char *host, int port) | |||
283 | int fd; | 295 | int fd; |
284 | FILE *fp; | 296 | FILE *fp; |
285 | 297 | ||
286 | memzero(&sin, sizeof(sin)); | 298 | memset(&sin, 0, sizeof(sin)); |
287 | sin.sin_family = AF_INET; | 299 | sin.sin_family = AF_INET; |
288 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) | 300 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) |
289 | error_msg_and_die("cannot resolve %s\n", host); | 301 | error_msg_and_die("cannot resolve %s\n", host); |
@@ -521,7 +533,7 @@ progressmeter(int flag) | |||
521 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 533 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
522 | * SUCH DAMAGE. | 534 | * SUCH DAMAGE. |
523 | * | 535 | * |
524 | * $Id: wget.c,v 1.22 2001/01/26 02:04:49 andersen Exp $ | 536 | * $Id: wget.c,v 1.23 2001/01/27 08:24:38 andersen Exp $ |
525 | */ | 537 | */ |
526 | 538 | ||
527 | 539 | ||
diff --git a/nslookup.c b/nslookup.c index 271518f22..1f37e313f 100644 --- a/nslookup.c +++ b/nslookup.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <string.h> | 28 | #include <string.h> |
29 | #include <stdlib.h> | ||
29 | 30 | ||
30 | #include <netdb.h> | 31 | #include <netdb.h> |
31 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
@@ -169,4 +170,4 @@ int nslookup_main(int argc, char **argv) | |||
169 | return EXIT_SUCCESS; | 170 | return EXIT_SUCCESS; |
170 | } | 171 | } |
171 | 172 | ||
172 | /* $Id: nslookup.c,v 1.18 2001/01/24 18:44:54 andersen Exp $ */ | 173 | /* $Id: nslookup.c,v 1.19 2001/01/27 08:24:37 andersen Exp $ */ |
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.34 2001/01/24 18:44:54 andersen Exp $ | 3 | * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -47,6 +47,9 @@ | |||
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | #include <errno.h> | 49 | #include <errno.h> |
50 | #include <unistd.h> | ||
51 | #include <string.h> | ||
52 | #include <stdlib.h> | ||
50 | 53 | ||
51 | 54 | ||
52 | /* It turns out that libc5 doesn't have proper icmp support | 55 | /* It turns out that libc5 doesn't have proper icmp support |
diff --git a/procps/free.c b/procps/free.c index f2e746e39..4dd99ab49 100644 --- a/procps/free.c +++ b/procps/free.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdlib.h> | ||
27 | 28 | ||
28 | extern int free_main(int argc, char **argv) | 29 | extern int free_main(int argc, char **argv) |
29 | { | 30 | { |
diff --git a/procps/kill.c b/procps/kill.c index 19ca187a7..3eb829abf 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <signal.h> | 29 | #include <signal.h> |
30 | #include <ctype.h> | 30 | #include <ctype.h> |
31 | #include <string.h> | ||
31 | #include <unistd.h> | 32 | #include <unistd.h> |
32 | 33 | ||
33 | static const int KILL = 0; | 34 | static const int KILL = 0; |
diff --git a/procps/ps.c b/procps/ps.c index cb4c21e32..aac064c2a 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -30,11 +30,13 @@ | |||
30 | 30 | ||
31 | #include "busybox.h" | 31 | #include "busybox.h" |
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <stdlib.h> | ||
33 | #include <unistd.h> | 34 | #include <unistd.h> |
34 | #include <dirent.h> | 35 | #include <dirent.h> |
35 | #include <errno.h> | 36 | #include <errno.h> |
36 | #include <fcntl.h> | 37 | #include <fcntl.h> |
37 | #include <ctype.h> | 38 | #include <ctype.h> |
39 | #include <string.h> | ||
38 | #include <sys/ioctl.h> | 40 | #include <sys/ioctl.h> |
39 | #define BB_DECLARE_EXTERN | 41 | #define BB_DECLARE_EXTERN |
40 | #define bb_need_help | 42 | #define bb_need_help |
diff --git a/procps/renice.c b/procps/renice.c index 8f0618126..9d85ba0d0 100644 --- a/procps/renice.c +++ b/procps/renice.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <errno.h> | 25 | #include <errno.h> |
26 | #include <stdlib.h> | ||
26 | #include <sys/time.h> | 27 | #include <sys/time.h> |
27 | #include <sys/resource.h> | 28 | #include <sys/resource.h> |
28 | 29 | ||
diff --git a/procps/uptime.c b/procps/uptime.c index b827f7e67..4463b94ef 100644 --- a/procps/uptime.c +++ b/procps/uptime.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <time.h> | 33 | #include <time.h> |
34 | #include <errno.h> | 34 | #include <errno.h> |
35 | #include <stdlib.h> | ||
35 | 36 | ||
36 | static const int FSHIFT = 16; /* nr of bits of precision */ | 37 | static const int FSHIFT = 16; /* nr of bits of precision */ |
37 | #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ | 38 | #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ |
@@ -30,11 +30,13 @@ | |||
30 | 30 | ||
31 | #include "busybox.h" | 31 | #include "busybox.h" |
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <stdlib.h> | ||
33 | #include <unistd.h> | 34 | #include <unistd.h> |
34 | #include <dirent.h> | 35 | #include <dirent.h> |
35 | #include <errno.h> | 36 | #include <errno.h> |
36 | #include <fcntl.h> | 37 | #include <fcntl.h> |
37 | #include <ctype.h> | 38 | #include <ctype.h> |
39 | #include <string.h> | ||
38 | #include <sys/ioctl.h> | 40 | #include <sys/ioctl.h> |
39 | #define BB_DECLARE_EXTERN | 41 | #define BB_DECLARE_EXTERN |
40 | #define bb_need_help | 42 | #define bb_need_help |
@@ -25,6 +25,8 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <dirent.h> | 26 | #include <dirent.h> |
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | #include <unistd.h> | ||
29 | #include <stdlib.h> | ||
28 | 30 | ||
29 | extern int pwd_main(int argc, char **argv) | 31 | extern int pwd_main(int argc, char **argv) |
30 | { | 32 | { |
@@ -31,6 +31,8 @@ | |||
31 | #include <netdb.h> | 31 | #include <netdb.h> |
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <getopt.h> | 33 | #include <getopt.h> |
34 | #include <stdlib.h> | ||
35 | #include <unistd.h> | ||
34 | 36 | ||
35 | 37 | ||
36 | static const int RFC_868_BIAS = 2208988800UL; | 38 | static const int RFC_868_BIAS = 2208988800UL; |
diff --git a/readlink.c b/readlink.c index bb2056a25..98f1dea4f 100644 --- a/readlink.c +++ b/readlink.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | #include <stdlib.h> | ||
28 | 29 | ||
29 | int readlink_main(int argc, char **argv) | 30 | int readlink_main(int argc, char **argv) |
30 | { | 31 | { |
@@ -23,6 +23,7 @@ | |||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <errno.h> | 25 | #include <errno.h> |
26 | #include <stdlib.h> | ||
26 | #include <sys/time.h> | 27 | #include <sys/time.h> |
27 | #include <sys/resource.h> | 28 | #include <sys/resource.h> |
28 | 29 | ||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include "busybox.h" | 26 | #include "busybox.h" |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <stdlib.h> | ||
28 | 29 | ||
29 | extern int reset_main(int argc, char **argv) | 30 | extern int reset_main(int argc, char **argv) |
30 | { | 31 | { |
@@ -28,6 +28,8 @@ | |||
28 | #include <utime.h> | 28 | #include <utime.h> |
29 | #include <dirent.h> | 29 | #include <dirent.h> |
30 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <unistd.h> | ||
32 | #include <stdlib.h> | ||
31 | 33 | ||
32 | static int recursiveFlag = FALSE; | 34 | static int recursiveFlag = FALSE; |
33 | static int forceFlag = FALSE; | 35 | static int forceFlag = FALSE; |
@@ -25,6 +25,8 @@ | |||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | #include <unistd.h> | ||
29 | #include <stdlib.h> | ||
28 | 30 | ||
29 | extern int rmdir_main(int argc, char **argv) | 31 | extern int rmdir_main(int argc, char **argv) |
30 | { | 32 | { |
@@ -25,6 +25,9 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | #include <stdlib.h> | ||
29 | #include <sys/syscall.h> | ||
30 | #include <linux/unistd.h> | ||
28 | #define __LIBRARY__ | 31 | #define __LIBRARY__ |
29 | 32 | ||
30 | 33 | ||
diff --git a/rpmunpack.c b/rpmunpack.c index 0f36077c1..85c7c9c1e 100644 --- a/rpmunpack.c +++ b/rpmunpack.c | |||
@@ -15,6 +15,9 @@ | |||
15 | 15 | ||
16 | #include "busybox.h" | 16 | #include "busybox.h" |
17 | #include <fcntl.h> | 17 | #include <fcntl.h> |
18 | #include <unistd.h> | ||
19 | #include <string.h> | ||
20 | #include <stdlib.h> | ||
18 | 21 | ||
19 | /* | 22 | /* |
20 | * Some general definitions | 23 | * Some general definitions |
@@ -47,9 +47,11 @@ | |||
47 | #include <string.h> /* for strdup() */ | 47 | #include <string.h> /* for strdup() */ |
48 | #include <errno.h> | 48 | #include <errno.h> |
49 | #include <ctype.h> /* for isspace() */ | 49 | #include <ctype.h> /* for isspace() */ |
50 | #include <stdlib.h> | ||
50 | #include "busybox.h" | 51 | #include "busybox.h" |
51 | 52 | ||
52 | /* externs */ | 53 | /* externs */ |
54 | extern void xregcomp(regex_t *preg, const char *regex, int cflags); | ||
53 | extern int optind; /* in unistd.h */ | 55 | extern int optind; /* in unistd.h */ |
54 | extern char *optarg; /* ditto */ | 56 | extern char *optarg; /* ditto */ |
55 | 57 | ||
@@ -23,6 +23,8 @@ | |||
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <unistd.h> | ||
27 | #include <stdlib.h> | ||
26 | 28 | ||
27 | extern int sleep_main(int argc, char **argv) | 29 | extern int sleep_main(int argc, char **argv) |
28 | { | 30 | { |
@@ -22,6 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <getopt.h> | ||
26 | #include <stdlib.h> | ||
25 | 27 | ||
26 | int compare_ascii(const void *x, const void *y) | 28 | int compare_ascii(const void *x, const void *y) |
27 | { | 29 | { |
diff --git a/swaponoff.c b/swaponoff.c index eda15100b..d792c708d 100644 --- a/swaponoff.c +++ b/swaponoff.c | |||
@@ -24,10 +24,13 @@ | |||
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <sys/mount.h> | ||
28 | #include <mntent.h> | 27 | #include <mntent.h> |
29 | #include <dirent.h> | 28 | #include <dirent.h> |
30 | #include <errno.h> | 29 | #include <errno.h> |
30 | #include <stdlib.h> | ||
31 | #include <sys/mount.h> | ||
32 | #include <sys/syscall.h> | ||
33 | #include <linux/unistd.h> | ||
31 | 34 | ||
32 | _syscall2(int, swapon, const char *, path, int, flags); | 35 | _syscall2(int, swapon, const char *, path, int, flags); |
33 | _syscall1(int, swapoff, const char *, path); | 36 | _syscall1(int, swapoff, const char *, path); |
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <unistd.h> | ||
26 | 27 | ||
27 | extern int sync_main(int argc, char **argv) | 28 | extern int sync_main(int argc, char **argv) |
28 | { | 29 | { |
diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 3d02979c8..d286f34d1 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <sys/types.h> | 27 | #include <sys/types.h> |
28 | #include <fcntl.h> | 28 | #include <fcntl.h> |
29 | #include <ctype.h> | 29 | #include <ctype.h> |
30 | #include <string.h> | ||
31 | #include <stdlib.h> | ||
30 | 32 | ||
31 | #if !defined BB_SYSLOGD | 33 | #if !defined BB_SYSLOGD |
32 | 34 | ||
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 972fda15f..3c36f68e8 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <signal.h> | 34 | #include <signal.h> |
35 | #include <stdarg.h> | 35 | #include <stdarg.h> |
36 | #include <time.h> | 36 | #include <time.h> |
37 | #include <string.h> | ||
37 | #include <unistd.h> | 38 | #include <unistd.h> |
38 | #include <sys/socket.h> | 39 | #include <sys/socket.h> |
39 | #include <sys/types.h> | 40 | #include <sys/types.h> |
@@ -41,7 +42,8 @@ | |||
41 | #include <sys/param.h> | 42 | #include <sys/param.h> |
42 | 43 | ||
43 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ | 44 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ |
44 | 45 | #include <sys/syscall.h> | |
46 | #include <linux/unistd.h> | ||
45 | typedef unsigned int socklen_t; | 47 | typedef unsigned int socklen_t; |
46 | 48 | ||
47 | #ifndef __alpha__ | 49 | #ifndef __alpha__ |
@@ -34,6 +34,7 @@ | |||
34 | #include <signal.h> | 34 | #include <signal.h> |
35 | #include <stdarg.h> | 35 | #include <stdarg.h> |
36 | #include <time.h> | 36 | #include <time.h> |
37 | #include <string.h> | ||
37 | #include <unistd.h> | 38 | #include <unistd.h> |
38 | #include <sys/socket.h> | 39 | #include <sys/socket.h> |
39 | #include <sys/types.h> | 40 | #include <sys/types.h> |
@@ -41,7 +42,8 @@ | |||
41 | #include <sys/param.h> | 42 | #include <sys/param.h> |
42 | 43 | ||
43 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ | 44 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ |
44 | 45 | #include <sys/syscall.h> | |
46 | #include <linux/unistd.h> | ||
45 | typedef unsigned int socklen_t; | 47 | typedef unsigned int socklen_t; |
46 | 48 | ||
47 | #ifndef __alpha__ | 49 | #ifndef __alpha__ |
@@ -23,8 +23,12 @@ | |||
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | 25 | ||
26 | #include <sys/types.h> | ||
27 | #include <fcntl.h> | 26 | #include <fcntl.h> |
27 | #include <getopt.h> | ||
28 | #include <string.h> | ||
29 | #include <stdlib.h> | ||
30 | #include <unistd.h> | ||
31 | #include <sys/types.h> | ||
28 | 32 | ||
29 | static struct suffix_mult tail_suffixes[] = { | 33 | static struct suffix_mult tail_suffixes[] = { |
30 | { "b", 512 }, | 34 | { "b", 512 }, |
@@ -52,6 +52,9 @@ | |||
52 | #include <sys/sysmacros.h> | 52 | #include <sys/sysmacros.h> |
53 | #include <getopt.h> | 53 | #include <getopt.h> |
54 | #include <fnmatch.h> | 54 | #include <fnmatch.h> |
55 | #include <string.h> | ||
56 | #include <stdlib.h> | ||
57 | #include <unistd.h> | ||
55 | 58 | ||
56 | #ifdef BB_FEATURE_TAR_GZIP | 59 | #ifdef BB_FEATURE_TAR_GZIP |
57 | extern int unzip(int in, int out); | 60 | extern int unzip(int in, int out); |
@@ -28,6 +28,8 @@ | |||
28 | #include <fcntl.h> | 28 | #include <fcntl.h> |
29 | #include <utime.h> | 29 | #include <utime.h> |
30 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <unistd.h> | ||
32 | #include <stdlib.h> | ||
31 | 33 | ||
32 | extern int touch_main(int argc, char **argv) | 34 | extern int touch_main(int argc, char **argv) |
33 | { | 35 | { |
@@ -191,9 +191,9 @@ extern int tr_main(int argc, char **argv) | |||
191 | map(input, input_length, output, output_length); | 191 | map(input, input_length, output, output_length); |
192 | } | 192 | } |
193 | for (i = 0; i < input_length; i++) | 193 | for (i = 0; i < input_length; i++) |
194 | invec[input[i]] = TRUE; | 194 | invec[(int)input[i]] = TRUE; |
195 | for (i = 0; i < output_length; i++) | 195 | for (i = 0; i < output_length; i++) |
196 | outvec[output[i]] = TRUE; | 196 | outvec[(int)output[i]] = TRUE; |
197 | } | 197 | } |
198 | convert(); | 198 | convert(); |
199 | return (0); | 199 | return (0); |
diff --git a/true_false.c b/true_false.c index 333541c9b..155b26286 100644 --- a/true_false.c +++ b/true_false.c | |||
@@ -23,6 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdlib.h> | ||
26 | 27 | ||
27 | 28 | ||
28 | extern int true_main(int argc, char **argv) | 29 | extern int true_main(int argc, char **argv) |
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <unistd.h> | ||
25 | #include <sys/types.h> | 27 | #include <sys/types.h> |
26 | 28 | ||
27 | extern int tty_main(int argc, char **argv) | 29 | extern int tty_main(int argc, char **argv) |
@@ -26,6 +26,8 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <mntent.h> | 27 | #include <mntent.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <string.h> | ||
30 | #include <stdlib.h> | ||
29 | 31 | ||
30 | 32 | ||
31 | static const int MNT_FORCE = 1; | 33 | static const int MNT_FORCE = 1; |
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include "busybox.h" | 34 | #include "busybox.h" |
35 | #include <stdio.h> | 35 | #include <stdio.h> |
36 | #include <stdlib.h> | ||
36 | #include <sys/types.h> | 37 | #include <sys/types.h> |
37 | #include <sys/utsname.h> | 38 | #include <sys/utsname.h> |
38 | 39 | ||
@@ -26,7 +26,9 @@ | |||
26 | #include "busybox.h" | 26 | #include "busybox.h" |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <string.h> | 28 | #include <string.h> |
29 | #include <getopt.h> | ||
29 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <stdlib.h> | ||
30 | 32 | ||
31 | static int print_count; | 33 | static int print_count; |
32 | static int print_uniq = 1; | 34 | static int print_uniq = 1; |
@@ -32,11 +32,14 @@ | |||
32 | #include <sys/param.h> | 32 | #include <sys/param.h> |
33 | #include <sys/syslog.h> | 33 | #include <sys/syslog.h> |
34 | #include <unistd.h> /* for getopt() */ | 34 | #include <unistd.h> /* for getopt() */ |
35 | #include <stdlib.h> | ||
35 | 36 | ||
36 | 37 | ||
37 | #if defined(__GLIBC__) | 38 | #if defined(__GLIBC__) |
38 | #include <sys/kdaemon.h> | 39 | #include <sys/kdaemon.h> |
39 | #else | 40 | #else |
41 | #include <sys/syscall.h> | ||
42 | #include <linux/unistd.h> | ||
40 | static _syscall2(int, bdflush, int, func, int, data); | 43 | static _syscall2(int, bdflush, int, func, int, data); |
41 | #endif /* __GLIBC__ */ | 44 | #endif /* __GLIBC__ */ |
42 | 45 | ||
@@ -32,6 +32,7 @@ | |||
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <time.h> | 33 | #include <time.h> |
34 | #include <errno.h> | 34 | #include <errno.h> |
35 | #include <stdlib.h> | ||
35 | 36 | ||
36 | static const int FSHIFT = 16; /* nr of bits of precision */ | 37 | static const int FSHIFT = 16; /* nr of bits of precision */ |
37 | #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ | 38 | #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ |
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index c220d9018..c21f84c9a 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c | |||
@@ -18,9 +18,11 @@ | |||
18 | #include "busybox.h" | 18 | #include "busybox.h" |
19 | #include <stdio.h> | 19 | #include <stdio.h> |
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include <getopt.h> | ||
21 | 22 | ||
22 | #if __GNU_LIBRARY__ < 5 | 23 | #if __GNU_LIBRARY__ < 5 |
23 | 24 | #include <sys/syscall.h> | |
25 | #include <linux/unistd.h> | ||
24 | #ifndef __alpha__ | 26 | #ifndef __alpha__ |
25 | # define __NR_klogctl __NR_syslog | 27 | # define __NR_klogctl __NR_syslog |
26 | static inline _syscall3(int, klogctl, int, type, char *, b, int, len); | 28 | static inline _syscall3(int, klogctl, int, type, char *, b, int, len); |
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 845be8442..637896bed 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <fcntl.h> | 31 | #include <fcntl.h> |
32 | #include <errno.h> | 32 | #include <errno.h> |
33 | #include <ctype.h> | 33 | #include <ctype.h> |
34 | #include <string.h> | ||
34 | #include <sys/ioctl.h> | 35 | #include <sys/ioctl.h> |
35 | 36 | ||
36 | #define DEFAULTFBDEV "/dev/fb0" | 37 | #define DEFAULTFBDEV "/dev/fb0" |
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c index 5eb93ddd7..fcf8ddd28 100644 --- a/util-linux/fdflush.c +++ b/util-linux/fdflush.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <sys/ioctl.h> | 26 | #include <sys/ioctl.h> |
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <stdlib.h> | ||
28 | 29 | ||
29 | /* From <linux/fd.h> */ | 30 | /* From <linux/fd.h> */ |
30 | #define FDFLUSH _IO(2,0x4b) | 31 | #define FDFLUSH _IO(2,0x4b) |
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index a2b17c673..8f90f40b5 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <sys/ioctl.h> | 28 | #include <sys/ioctl.h> |
29 | #include <errno.h> | 29 | #include <errno.h> |
30 | #include <stdlib.h> | ||
30 | #include "busybox.h" | 31 | #include "busybox.h" |
31 | 32 | ||
32 | 33 | ||
diff --git a/util-linux/more.c b/util-linux/more.c index 03cb3bc2b..c4c74fe4a 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <fcntl.h> | 30 | #include <fcntl.h> |
31 | #include <signal.h> | 31 | #include <signal.h> |
32 | #include <stdlib.h> | ||
32 | #include <sys/ioctl.h> | 33 | #include <sys/ioctl.h> |
33 | #define BB_DECLARE_EXTERN | 34 | #define BB_DECLARE_EXTERN |
34 | #define bb_need_help | 35 | #define bb_need_help |
diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 954982ae9..0ad339be8 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <netdb.h> | 31 | #include <netdb.h> |
32 | #include <stdio.h> | 32 | #include <stdio.h> |
33 | #include <getopt.h> | 33 | #include <getopt.h> |
34 | #include <stdlib.h> | ||
35 | #include <unistd.h> | ||
34 | 36 | ||
35 | 37 | ||
36 | static const int RFC_868_BIAS = 2208988800UL; | 38 | static const int RFC_868_BIAS = 2208988800UL; |
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index eda15100b..d792c708d 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c | |||
@@ -24,10 +24,13 @@ | |||
24 | 24 | ||
25 | #include "busybox.h" | 25 | #include "busybox.h" |
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <sys/mount.h> | ||
28 | #include <mntent.h> | 27 | #include <mntent.h> |
29 | #include <dirent.h> | 28 | #include <dirent.h> |
30 | #include <errno.h> | 29 | #include <errno.h> |
30 | #include <stdlib.h> | ||
31 | #include <sys/mount.h> | ||
32 | #include <sys/syscall.h> | ||
33 | #include <linux/unistd.h> | ||
31 | 34 | ||
32 | _syscall2(int, swapon, const char *, path, int, flags); | 35 | _syscall2(int, swapon, const char *, path, int, flags); |
33 | _syscall1(int, swapoff, const char *, path); | 36 | _syscall1(int, swapoff, const char *, path); |
diff --git a/util-linux/umount.c b/util-linux/umount.c index 2e2d95de4..dfd58259d 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <mntent.h> | 27 | #include <mntent.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <string.h> | ||
30 | #include <stdlib.h> | ||
29 | 31 | ||
30 | 32 | ||
31 | static const int MNT_FORCE = 1; | 33 | static const int MNT_FORCE = 1; |
@@ -50,11 +50,17 @@ | |||
50 | #include <utime.h> | 50 | #include <utime.h> |
51 | #include <unistd.h> | 51 | #include <unistd.h> |
52 | #include <ctype.h> | 52 | #include <ctype.h> |
53 | #include <stdlib.h> | ||
53 | #include <sys/ioctl.h> | 54 | #include <sys/ioctl.h> |
54 | #include <sys/utsname.h> /* for uname(2) */ | 55 | #include <sys/utsname.h> /* for uname(2) */ |
56 | |||
55 | #include "pwd_grp/pwd.h" | 57 | #include "pwd_grp/pwd.h" |
56 | #include "pwd_grp/grp.h" | 58 | #include "pwd_grp/grp.h" |
57 | 59 | ||
60 | /* for the _syscall() macros */ | ||
61 | #include <sys/syscall.h> | ||
62 | #include <linux/unistd.h> | ||
63 | |||
58 | /* Busybox mount uses either /proc/filesystems or /dev/mtab to get the | 64 | /* Busybox mount uses either /proc/filesystems or /dev/mtab to get the |
59 | * list of available filesystems used for the -t auto option */ | 65 | * list of available filesystems used for the -t auto option */ |
60 | #if defined BB_FEATURE_USE_PROCFS && defined BB_FEATURE_USE_DEVPS_PATCH | 66 | #if defined BB_FEATURE_USE_PROCFS && defined BB_FEATURE_USE_DEVPS_PATCH |
@@ -1123,6 +1129,7 @@ extern int check_wildcard_match(const char *text, const char *pattern) | |||
1123 | 1129 | ||
1124 | 1130 | ||
1125 | #if defined BB_DF || defined BB_MTAB | 1131 | #if defined BB_DF || defined BB_MTAB |
1132 | #include <mntent.h> | ||
1126 | /* | 1133 | /* |
1127 | * Given a block device, find the mount table entry if that block device | 1134 | * Given a block device, find the mount table entry if that block device |
1128 | * is mounted. | 1135 | * is mounted. |
@@ -1645,6 +1652,7 @@ char *get_last_path_component(char *path) | |||
1645 | #endif | 1652 | #endif |
1646 | 1653 | ||
1647 | #if defined BB_GREP || defined BB_SED | 1654 | #if defined BB_GREP || defined BB_SED |
1655 | #include <regex.h> | ||
1648 | void xregcomp(regex_t *preg, const char *regex, int cflags) | 1656 | void xregcomp(regex_t *preg, const char *regex, int cflags) |
1649 | { | 1657 | { |
1650 | int ret; | 1658 | int ret; |
diff --git a/uudecode.c b/uudecode.c index 7b26d2dad..fcfcfd903 100644 --- a/uudecode.c +++ b/uudecode.c | |||
@@ -27,6 +27,10 @@ | |||
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <getopt.h> | 29 | #include <getopt.h> |
30 | #include <string.h> | ||
31 | #include <stdlib.h> | ||
32 | #include "pwd_grp/pwd.h" | ||
33 | #include "pwd_grp/grp.h" | ||
30 | 34 | ||
31 | /*struct passwd *getpwnam();*/ | 35 | /*struct passwd *getpwnam();*/ |
32 | 36 | ||
diff --git a/uuencode.c b/uuencode.c index 24aabd373..5df49026b 100644 --- a/uuencode.c +++ b/uuencode.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <getopt.h> | 29 | #include <getopt.h> |
30 | #include <stdlib.h> | ||
30 | 31 | ||
31 | #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) | 32 | #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
32 | 33 | ||
diff --git a/watchdog.c b/watchdog.c index d297afa02..7026cc005 100644 --- a/watchdog.c +++ b/watchdog.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <fcntl.h> | 25 | #include <fcntl.h> |
26 | #include <unistd.h> | ||
27 | #include <stdlib.h> | ||
26 | 28 | ||
27 | extern int watchdog_main(int argc, char **argv) | 29 | extern int watchdog_main(int argc, char **argv) |
28 | { | 30 | { |
@@ -23,6 +23,7 @@ | |||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <getopt.h> | 25 | #include <getopt.h> |
26 | #include <stdlib.h> | ||
26 | 27 | ||
27 | static int total_lines, total_words, total_chars, max_length; | 28 | static int total_lines, total_words, total_chars, max_length; |
28 | static int print_lines, print_words, print_chars, print_length; | 29 | static int print_lines, print_words, print_chars, print_length; |
@@ -33,6 +33,18 @@ | |||
33 | #include <arpa/inet.h> | 33 | #include <arpa/inet.h> |
34 | #include <netdb.h> | 34 | #include <netdb.h> |
35 | 35 | ||
36 | /* Stupid libc5 doesn't define this... */ | ||
37 | #ifndef timersub | ||
38 | #define timersub(a, b, result) \ | ||
39 | do { \ | ||
40 | (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ | ||
41 | (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ | ||
42 | if ((result)->tv_usec < 0) { \ | ||
43 | --(result)->tv_sec; \ | ||
44 | (result)->tv_usec += 1000000; \ | ||
45 | } \ | ||
46 | } while (0) | ||
47 | #endif | ||
36 | 48 | ||
37 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); | 49 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); |
38 | FILE *open_socket(char *host, int port); | 50 | FILE *open_socket(char *host, int port); |
@@ -283,7 +295,7 @@ FILE *open_socket(char *host, int port) | |||
283 | int fd; | 295 | int fd; |
284 | FILE *fp; | 296 | FILE *fp; |
285 | 297 | ||
286 | memzero(&sin, sizeof(sin)); | 298 | memset(&sin, 0, sizeof(sin)); |
287 | sin.sin_family = AF_INET; | 299 | sin.sin_family = AF_INET; |
288 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) | 300 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) |
289 | error_msg_and_die("cannot resolve %s\n", host); | 301 | error_msg_and_die("cannot resolve %s\n", host); |
@@ -521,7 +533,7 @@ progressmeter(int flag) | |||
521 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 533 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
522 | * SUCH DAMAGE. | 534 | * SUCH DAMAGE. |
523 | * | 535 | * |
524 | * $Id: wget.c,v 1.22 2001/01/26 02:04:49 andersen Exp $ | 536 | * $Id: wget.c,v 1.23 2001/01/27 08:24:38 andersen Exp $ |
525 | */ | 537 | */ |
526 | 538 | ||
527 | 539 | ||
@@ -22,7 +22,9 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "busybox.h" | 24 | #include "busybox.h" |
25 | #include <string.h> | ||
25 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <stdlib.h> | ||
26 | 28 | ||
27 | extern int which_main(int argc, char **argv) | 29 | extern int which_main(int argc, char **argv) |
28 | { | 30 | { |
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
26 | #include <unistd.h> | ||
25 | 27 | ||
26 | extern int whoami_main(int argc, char **argv) | 28 | extern int whoami_main(int argc, char **argv) |
27 | { | 29 | { |
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include "busybox.h" | 23 | #include "busybox.h" |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | ||
25 | 26 | ||
26 | extern int yes_main(int argc, char **argv) | 27 | extern int yes_main(int argc, char **argv) |
27 | { | 28 | { |