#endif
#endif
//
-#if defined BB_FEATURE_LINUXRC || defined BB_LINUXRC
#ifndef BB_INIT
-#define BB_INIT
-#endif
-#ifndef BB_LINUXRC
-#define BB_LINUXRC
-#endif
+#undef BB_LINUXRC
+#undef BB_FEATURE_LINUXRC
#endif
//
#ifdef BB_GZIP
CC = $(CROSS)gcc
STRIPTOOL = $(CROSS)strip
-# To compile vs an alternative libc, you may need to use/adjust
-# the following lines to meet your needs. This is how I make
-# busybox compile staticly with uClibc (needs BB_FEATURE_NFSMOUNT
-# disabled at the moment). Note the _full_ path for LIBCDIR.
-# This is because make doesn't do ~ expansion...
-#LIBCDIR=/home/andersen/CVS/uClibc
+# To compile vs uClibc, just use the compiler wrapper built by uClibc...
+# Isn't that easy? Right now, uClibc needs BB_FEATURE_NFSMOUNT disabled
+# since uClibc's nfs support isn't ready yet.
+#CC = ../uClibc/extra/gcc-uClibc/gcc-uClibc-i386
+
+# To compile vs some other alternative libc, you may need to use/adjust
+# the following lines to meet your needs...
+#LIBCDIR=/usr/i486-linuxlibc1/
#LDFLAGS+=-nostdlib
#LIBRARIES = $(LIBCDIR)/libc.a -lgcc
#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
-# This is how I compile with the uClibc shared lib...
-#LIBCDIR=/home/andersen/CVS/uClibc
-#LDFLAGS+=-nostdlib
-#LIBRARIES = -luClibc -lgcc $(LIBCDIR)/crt0.o
-#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
-#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
-
#--------------------------------------------------------
# use '-Os' optimization if available, else use -O2
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
#undef APPLET
#undef APPLET_NOUSAGE
*
*/
#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <unistd.h>
#include "busybox.h"
typedef struct ar_headers_s {
*
*/
#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <unistd.h>
#include "busybox.h"
typedef struct ar_headers_s {
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
#include "busybox.h"
typedef struct ar_headers_s {
*/
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#define memzero(s, n) memset ((void *)(s), 0, (n))
#ifndef RETSIGTYPE
#include <sys/sysmacros.h>
#include <getopt.h>
#include <fnmatch.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
#ifdef BB_FEATURE_TAR_GZIP
extern int unzip(int in, int out);
*/
#include "busybox.h"
-#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
extern int basename_main(int argc, char **argv)
{
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
#undef APPLET
#undef APPLET_NOUSAGE
#include "Config.h"
-#include <stdlib.h>
+#include <stdio.h>
#include <stdarg.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <sys/types.h>
-#include <mntent.h>
-#include <regex.h>
-/* for the _syscall() macros */
-#include <sys/syscall.h>
-#include <linux/unistd.h>
#ifdef DMALLOC
#include "dmalloc.h"
#endif
-/* I don't like nested includes, but the string and io functions are used
- * too often
- */
-#include <stdio.h>
-#if !defined(NO_STRING_H) || defined(STDC_HEADERS)
-# include <string.h>
-# if !defined(STDC_HEADERS) && !defined(NO_MEMORY_H) && !defined(__GNUC__)
-# include <memory.h>
-# endif
-# define memzero(s, n) memset ((void *)(s), 0, (n))
-#else
-# include <strings.h>
-# define strchr index
-# define strrchr rindex
-# define memcpy(d, s, n) bcopy((s), (d), (n))
-# define memcmp(s1, s2, n) bcmp((s1), (s2), (n))
-# define memzero(s, n) bzero((s), (n))
-#endif
-
-
enum Location {
_BB_DIR_ROOT = 0,
_BB_DIR_BIN,
extern int print_file_by_name(char *filename);
extern char process_escape_sequence(char **ptr);
extern char *get_last_path_component(char *path);
-extern void xregcomp(regex_t *preg, const char *regex, int cflags);
extern FILE *wfopen(const char *path, const char *mode);
extern FILE *xfopen(const char *path, const char *mode);
*/
#include "busybox.h"
-#include <stdio.h>
+#include <stdlib.h>
extern int cat_main(int argc, char **argv)
{
#include "messages.c"
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
static long uid = -1;
#include "busybox.h"
#include <stdlib.h>
#include <stdio.h>
+#include <unistd.h>
#include <errno.h>
int chroot_main(int argc, char **argv)
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
extern int clear_main(int argc, char **argv)
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
int cmp_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
extern int clear_main(int argc, char **argv)
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
/* From <linux/kd.h> */
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <sys/ioctl.h>
#define BINARY_KEYMAP_MAGIC "bkeymap"
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
extern int reset_main(int argc, char **argv)
{
*/
#include "busybox.h"
-#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
extern int basename_main(int argc, char **argv)
{
*/
#include "busybox.h"
-#include <stdio.h>
+#include <stdlib.h>
extern int cat_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdlib.h>
#include <stdio.h>
+#include <unistd.h>
#include <errno.h>
int chroot_main(int argc, char **argv)
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
int cmp_main(int argc, char **argv)
{
#include <unistd.h>
#include <time.h>
#include <stdio.h>
+#include <string.h>
#include <getopt.h>
#include "busybox.h"
#include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
#include <fcntl.h>
static struct suffix_mult dd_suffixes[] = {
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
#include <mntent.h>
#include <sys/vfs.h>
+#include <getopt.h>
extern const char mtab_file[]; /* Defined in utility.c */
#ifdef BB_FEATURE_HUMAN_READABLE
*/
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
extern int dirname_main(int argc, char **argv)
{
#include <fcntl.h>
#include <dirent.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <getopt.h>
#include <errno.h>
#ifdef BB_FEATURE_HUMAN_READABLE
return status;
}
-/* $Id: du.c,v 1.34 2001/01/22 22:35:38 rjune Exp $ */
+/* $Id: du.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ */
/*
Local Variables:
c-file-style: "linux"
#include "busybox.h"
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
extern int
echo_main(int argc, char** argv)
#include "busybox.h"
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <regex.h>
#include <sys/types.h>
-#include <regex.h>
/* The kinds of value we can have. */
enum valtype {
#include "busybox.h"
#include <errno.h>
#include <stdio.h>
+#include <getopt.h>
+#include <stdlib.h>
int head(int len, FILE *fp)
{
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
extern int hostid_main(int argc, char **argv)
{
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
+#include <string.h>
#include <sys/types.h>
extern int id_main(int argc, char **argv)
#include <stdio.h>
#include <dirent.h>
+#include <string.h>
+#include <stdlib.h>
#include <errno.h>
+#include <unistd.h>
static const int LN_SYMLINK = 1;
static const int LN_FORCE = 2;
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
extern int logname_main(int argc, char **argv)
{
#include <time.h>
#endif
#include <string.h>
+#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
static int parentFlag = FALSE;
static mode_t mode = 0777;
#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
+#include <stdlib.h>
extern int mkfifo_main(int argc, char **argv)
{
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
int mknod_main(int argc, char **argv)
{
#include <stdio.h>
#include <dirent.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int pwd_main(int argc, char **argv)
{
#include <utime.h>
#include <dirent.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
static int recursiveFlag = FALSE;
static int forceFlag = FALSE;
#include "busybox.h"
#include <stdio.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int rmdir_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int sleep_main(int argc, char **argv)
{
*/
#include "busybox.h"
+#include <getopt.h>
+#include <stdlib.h>
int compare_ascii(const void *x, const void *y)
{
#include "busybox.h"
#include <stdio.h>
+#include <unistd.h>
extern int sync_main(int argc, char **argv)
{
#include "busybox.h"
-#include <sys/types.h>
#include <fcntl.h>
+#include <getopt.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
static struct suffix_mult tail_suffixes[] = {
{ "b", 512 },
#include <fcntl.h>
#include <utime.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int touch_main(int argc, char **argv)
{
map(input, input_length, output, output_length);
}
for (i = 0; i < input_length; i++)
- invec[input[i]] = TRUE;
+ invec[(int)input[i]] = TRUE;
for (i = 0; i < output_length; i++)
- outvec[output[i]] = TRUE;
+ outvec[(int)output[i]] = TRUE;
}
convert();
return (0);
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <sys/types.h>
extern int tty_main(int argc, char **argv)
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include "busybox.h"
#include <stdio.h>
#include <string.h>
+#include <getopt.h>
#include <errno.h>
+#include <stdlib.h>
static int print_count;
static int print_uniq = 1;
#include <stdio.h>
#include <errno.h>
#include <getopt.h>
+#include <string.h>
+#include <stdlib.h>
+#include "pwd_grp/pwd.h"
+#include "pwd_grp/grp.h"
/*struct passwd *getpwnam();*/
#include <stdio.h>
#include <errno.h>
#include <getopt.h>
+#include <stdlib.h>
#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
#include "busybox.h"
#include <stdio.h>
#include <getopt.h>
+#include <stdlib.h>
static int total_lines, total_words, total_chars, max_length;
static int print_lines, print_words, print_chars, print_length;
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
extern int whoami_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
extern int yes_main(int argc, char **argv)
{
#include <unistd.h>
#include <errno.h>
#include <getopt.h>
+#include <stdlib.h>
static const int is_cp = 0;
static const int is_mv = 1;
#include <unistd.h>
#include <time.h>
#include <stdio.h>
+#include <string.h>
#include <getopt.h>
#include "busybox.h"
#include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
#include <fcntl.h>
static struct suffix_mult dd_suffixes[] = {
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
#include <mntent.h>
#include <sys/vfs.h>
+#include <getopt.h>
extern const char mtab_file[]; /* Defined in utility.c */
#ifdef BB_FEATURE_HUMAN_READABLE
*/
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
extern int dirname_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
+#include <getopt.h>
#if __GNU_LIBRARY__ < 5
-
+#include <sys/syscall.h>
+#include <linux/unistd.h>
#ifndef __alpha__
# define __NR_klogctl __NR_syslog
static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
#include "busybox.h"
typedef struct ar_headers_s {
#include <fcntl.h>
#include <dirent.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <getopt.h>
#include <errno.h>
#ifdef BB_FEATURE_HUMAN_READABLE
return status;
}
-/* $Id: du.c,v 1.34 2001/01/22 22:35:38 rjune Exp $ */
+/* $Id: du.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ */
/*
Local Variables:
c-file-style: "linux"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
/* From <linux/kd.h> */
#define bb_need_io_error
#include "messages.c"
#include <utmp.h>
+#include <stdlib.h>
+#include <unistd.h>
extern int dutmp_main(int argc, char **argv)
{
} else {
file = open(argv[1], O_RDONLY);
if (file < 0) {
- error_msg_and_die(io_error, argv[1], strerror(errno));
+ perror_msg_and_die(io_error, argv[1]);
}
}
#include "busybox.h"
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
extern int
echo_main(int argc, char** argv)
#include <string.h> /* for strdup() */
#include <errno.h>
#include <ctype.h> /* for isspace() */
+#include <stdlib.h>
#include "busybox.h"
/* externs */
+extern void xregcomp(regex_t *preg, const char *regex, int cflags);
extern int optind; /* in unistd.h */
extern char *optarg; /* ditto */
#include "busybox.h"
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <regex.h>
#include <sys/types.h>
-#include <regex.h>
/* The kinds of value we can have. */
enum valtype {
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
+#include <string.h>
#include <sys/ioctl.h>
#define DEFAULTFBDEV "/dev/fb0"
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
+#include <stdlib.h>
/* From <linux/fd.h> */
#define FDFLUSH _IO(2,0x4b)
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
+#include <string.h>
+#include <stdlib.h>
static char *pattern = NULL;
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
+#include <string.h>
+#include <stdlib.h>
static char *pattern = NULL;
#include <errno.h>
#include "busybox.h"
+extern void xregcomp(regex_t *preg, const char *regex, int cflags);
+
extern int optind; /* in unistd.h */
extern int errno; /* for use with strerror() */
*/
#include "busybox.h"
+#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
extern int which_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
#include <errno.h>
+#include <stdlib.h>
extern int free_main(int argc, char **argv)
{
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
+#include <stdlib.h>
#include "busybox.h"
#include <errno.h>
#include "busybox.h"
+extern void xregcomp(regex_t *preg, const char *regex, int cflags);
+
extern int optind; /* in unistd.h */
extern int errno; /* for use with strerror() */
*/
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#define memzero(s, n) memset ((void *)(s), 0, (n))
#ifndef RETSIGTYPE
#include "busybox.h"
#include <errno.h>
#include <stdio.h>
+#include <getopt.h>
+#include <stdlib.h>
int head(int len, FILE *fp)
{
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
extern int hostid_main(int argc, char **argv)
{
/* vi: set sw=4 ts=4: */
/*
- * $Id: hostname.c,v 1.20 2001/01/24 18:44:54 andersen Exp $
+ * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $
* Mini hostname implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
+#include <string.h>
#include <stdio.h>
void do_sethostname(char *s, int isfile)
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
+#include <string.h>
#include <sys/types.h>
extern int id_main(int argc, char **argv)
#include "Config.h"
-#include <stdlib.h>
+#include <stdio.h>
#include <stdarg.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <sys/types.h>
-#include <mntent.h>
-#include <regex.h>
-/* for the _syscall() macros */
-#include <sys/syscall.h>
-#include <linux/unistd.h>
#ifdef DMALLOC
#include "dmalloc.h"
#endif
-/* I don't like nested includes, but the string and io functions are used
- * too often
- */
-#include <stdio.h>
-#if !defined(NO_STRING_H) || defined(STDC_HEADERS)
-# include <string.h>
-# if !defined(STDC_HEADERS) && !defined(NO_MEMORY_H) && !defined(__GNUC__)
-# include <memory.h>
-# endif
-# define memzero(s, n) memset ((void *)(s), 0, (n))
-#else
-# include <strings.h>
-# define strchr index
-# define strrchr rindex
-# define memcpy(d, s, n) bcopy((s), (d), (n))
-# define memcmp(s1, s2, n) bcmp((s1), (s2), (n))
-# define memzero(s, n) bzero((s), (n))
-#endif
-
-
enum Location {
_BB_DIR_ROOT = 0,
_BB_DIR_BIN,
extern int print_file_by_name(char *filename);
extern char process_escape_sequence(char **ptr);
extern char *get_last_path_component(char *path);
-extern void xregcomp(regex_t *preg, const char *regex, int cflags);
extern FILE *wfopen(const char *path, const char *mode);
extern FILE *xfopen(const char *path, const char *mode);
#include <grp.h>
#else
-#define bb_setgrent setgrent
-#define bb_endgrent endgrent
-#define bb_getgrent getgrent
-#define bb_getgrgid getgrgid
-#define bb_getgrnam getgrnam
-#define bb_fgetgrent fgetgrent
-#define bb_setgroups setgroups
-#define bb_initgroups initgroups
-#define __bb_getgrent __getgrent
-
#include <sys/types.h>
#include <features.h>
#include <stdio.h>
char **gr_mem; /* Member list. */
};
-extern void bb_setgrent __P ((void));
-extern void bb_endgrent __P ((void));
-extern struct group * bb_getgrent __P ((void));
+extern void setgrent __P ((void));
+extern void endgrent __P ((void));
+extern struct group * getgrent __P ((void));
-extern struct group * bb_getgrgid __P ((__const gid_t gid));
-extern struct group * bb_getgrnam __P ((__const char * name));
+extern struct group * getgrgid __P ((__const gid_t gid));
+extern struct group * getgrnam __P ((__const char * name));
-extern struct group * bb_fgetgrent __P ((FILE * file));
+extern struct group * fgetgrent __P ((FILE * file));
-extern int bb_setgroups __P ((size_t n, __const gid_t * groups));
-extern int bb_initgroups __P ((__const char * user, gid_t gid));
+extern int setgroups __P ((size_t n, __const gid_t * groups));
+extern int initgroups __P ((__const char * user, gid_t gid));
-extern struct group * __bb_getgrent __P ((int grp_fd));
+extern struct group * __getgrent __P ((int grp_fd));
#endif /* USE_SYSTEM_PWD_GRP */
#endif /* __BB_GRP_H */
#include <pwd.h>
#else
-#define bb_setpwent setpwent
-#define bb_endpwent endpwent
-#define bb_getpwent getpwent
-#define bb_putpwent putpwent
-#define bb_getpw getpw
-#define bb_fgetpwent fgetpwent
-#define bb_getpwuid getpwuid
-#define bb_getpwnam getpwnam
-#define __bb_getpwent __bb_getpwent
-
-
#include <sys/types.h>
#include <features.h>
#include <stdio.h>
char *pw_shell; /* Shell program. */
};
-extern void bb_setpwent __P ((void));
-extern void bb_endpwent __P ((void));
-extern struct passwd * bb_getpwent __P ((void));
+extern void setpwent __P ((void));
+extern void endpwent __P ((void));
+extern struct passwd * getpwent __P ((void));
-extern int bb_putpwent __P ((__const struct passwd * __p, FILE * __f));
-extern int bb_getpw __P ((uid_t uid, char *buf));
+extern int putpwent __P ((__const struct passwd * __p, FILE * __f));
+extern int getpw __P ((uid_t uid, char *buf));
-extern struct passwd * bb_fgetpwent __P ((FILE * file));
+extern struct passwd * fgetpwent __P ((FILE * file));
-extern struct passwd * bb_getpwuid __P ((__const uid_t));
-extern struct passwd * bb_getpwnam __P ((__const char *));
+extern struct passwd * getpwuid __P ((__const uid_t));
+extern struct passwd * getpwnam __P ((__const char *));
-extern struct passwd * __bb_getpwent __P ((__const int passwd_fd));
+extern struct passwd * __getpwent __P ((__const int passwd_fd));
#endif /* USE_SYSTEM_PWD_GRP */
#endif /* __BB_PWD_H */
#include <string.h>
#include <termios.h>
#include <unistd.h>
+#include <limits.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#if defined(__GLIBC__)
#include <sys/kdaemon.h>
#else
+#include <sys/syscall.h>
+#include <linux/unistd.h>
static _syscall2(int, bdflush, int, func, int, data);
#endif /* __GLIBC__ */
#include <string.h>
#include <termios.h>
#include <unistd.h>
+#include <limits.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#if defined(__GLIBC__)
#include <sys/kdaemon.h>
#else
+#include <sys/syscall.h>
+#include <linux/unistd.h>
static _syscall2(int, bdflush, int, func, int, data);
#endif /* __GLIBC__ */
#include <dirent.h>
#include <ctype.h>
#include <assert.h>
+#include <string.h>
#include <getopt.h>
#include <sys/utsname.h>
+#include <sys/syscall.h>
+#include <linux/unistd.h>
//----------------------------------------------------------------------------
//--------modutils module.h, lines 45-242
#ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1;
-#ident "$Id: insmod.c,v 1.42 2001/01/26 02:23:57 andersen Exp $"
+#ident "$Id: insmod.c,v 1.43 2001/01/27 08:24:37 andersen Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
#ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1;
-#ident "$Id: insmod.c,v 1.42 2001/01/26 02:23:57 andersen Exp $"
+#ident "$Id: insmod.c,v 1.43 2001/01/27 08:24:37 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */
#include <unistd.h>
#include <signal.h>
#include <ctype.h>
+#include <string.h>
#include <unistd.h>
static const int KILL = 0;
#include <stdio.h>
#include <dirent.h>
+#include <string.h>
+#include <stdlib.h>
#include <errno.h>
+#include <unistd.h>
static const int LN_SYMLINK = 1;
static const int LN_FORCE = 2;
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <sys/ioctl.h>
#define BINARY_KEYMAP_MAGIC "bkeymap"
#include <sys/types.h>
#include <fcntl.h>
#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
#if !defined BB_SYSLOGD
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
extern int logname_main(int argc, char **argv)
{
#include <time.h>
#endif
#include <string.h>
+#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
#define bb_need_io_error
#include "messages.c"
#include <utmp.h>
+#include <stdlib.h>
+#include <unistd.h>
extern int dutmp_main(int argc, char **argv)
{
} else {
file = open(argv[1], O_RDONLY);
if (file < 0) {
- error_msg_and_die(io_error, argv[1], strerror(errno));
+ perror_msg_and_die(io_error, argv[1]);
}
}
#include "busybox.h"
#include <stdio.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int mktemp_main(int argc, char **argv)
{
/* vi: set sw=4 ts=4: */
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
#include <sys/mtio.h>
#include <sys/fcntl.h>
#include "busybox.h"
#include <errno.h>
#include <unistd.h>
+#include <stdlib.h>
int readlink_main(int argc, char **argv)
{
#include <sys/param.h>
#include <sys/syslog.h>
#include <unistd.h> /* for getopt() */
+#include <stdlib.h>
#if defined(__GLIBC__)
#include <sys/kdaemon.h>
#else
+#include <sys/syscall.h>
+#include <linux/unistd.h>
static _syscall2(int, bdflush, int, func, int, data);
#endif /* __GLIBC__ */
#include "busybox.h"
#include <stdio.h>
#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int watchdog_main(int argc, char **argv)
{
#include <stdio.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
static int parentFlag = FALSE;
static mode_t mode = 0777;
#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
+#include <stdlib.h>
extern int mkfifo_main(int argc, char **argv)
{
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
int mknod_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int mktemp_main(int argc, char **argv)
{
#include <dirent.h>
#include <ctype.h>
#include <assert.h>
+#include <string.h>
#include <getopt.h>
#include <sys/utsname.h>
+#include <sys/syscall.h>
+#include <linux/unistd.h>
//----------------------------------------------------------------------------
//--------modutils module.h, lines 45-242
#ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1;
-#ident "$Id: insmod.c,v 1.42 2001/01/26 02:23:57 andersen Exp $"
+#ident "$Id: insmod.c,v 1.43 2001/01/27 08:24:37 andersen Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
#ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1;
-#ident "$Id: insmod.c,v 1.42 2001/01/26 02:23:57 andersen Exp $"
+#ident "$Id: insmod.c,v 1.43 2001/01/27 08:24:37 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
+#include <stdlib.h>
+#include <sys/syscall.h>
+#include <linux/unistd.h>
#define __LIBRARY__
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
#define BB_DECLARE_EXTERN
#define bb_need_help
/* vi: set sw=4 ts=4: */
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
#include <sys/mtio.h>
#include <sys/fcntl.h>
/* vi: set sw=4 ts=4: */
/*
- * $Id: hostname.c,v 1.20 2001/01/24 18:44:54 andersen Exp $
+ * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $
* Mini hostname implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
+#include <string.h>
#include <stdio.h>
void do_sethostname(char *s, int isfile)
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <netdb.h>
#include <sys/socket.h>
return EXIT_SUCCESS;
}
-/* $Id: nslookup.c,v 1.18 2001/01/24 18:44:54 andersen Exp $ */
+/* $Id: nslookup.c,v 1.19 2001/01/27 08:24:37 andersen Exp $ */
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.34 2001/01/24 18:44:54 andersen Exp $
+ * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
/* It turns out that libc5 doesn't have proper icmp support
#include <arpa/inet.h>
#include <netdb.h>
+/* Stupid libc5 doesn't define this... */
+#ifndef timersub
+#define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif
void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
FILE *open_socket(char *host, int port);
int fd;
FILE *fp;
- memzero(&sin, sizeof(sin));
+ memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
if ((hp = (struct hostent *) gethostbyname(host)) == NULL)
error_msg_and_die("cannot resolve %s\n", host);
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wget.c,v 1.22 2001/01/26 02:04:49 andersen Exp $
+ * $Id: wget.c,v 1.23 2001/01/27 08:24:38 andersen Exp $
*/
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <netdb.h>
#include <sys/socket.h>
return EXIT_SUCCESS;
}
-/* $Id: nslookup.c,v 1.18 2001/01/24 18:44:54 andersen Exp $ */
+/* $Id: nslookup.c,v 1.19 2001/01/27 08:24:37 andersen Exp $ */
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.34 2001/01/24 18:44:54 andersen Exp $
+ * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
/* It turns out that libc5 doesn't have proper icmp support
#include "busybox.h"
#include <stdio.h>
#include <errno.h>
+#include <stdlib.h>
extern int free_main(int argc, char **argv)
{
#include <unistd.h>
#include <signal.h>
#include <ctype.h>
+#include <string.h>
#include <unistd.h>
static const int KILL = 0;
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
+#include <string.h>
#include <sys/ioctl.h>
#define BB_DECLARE_EXTERN
#define bb_need_help
#include "busybox.h"
#include <stdio.h>
#include <errno.h>
+#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <stdio.h>
#include <time.h>
#include <errno.h>
+#include <stdlib.h>
static const int FSHIFT = 16; /* nr of bits of precision */
#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
+#include <string.h>
#include <sys/ioctl.h>
#define BB_DECLARE_EXTERN
#define bb_need_help
#include <stdio.h>
#include <dirent.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int pwd_main(int argc, char **argv)
{
#include <netdb.h>
#include <stdio.h>
#include <getopt.h>
+#include <stdlib.h>
+#include <unistd.h>
static const int RFC_868_BIAS = 2208988800UL;
#include "busybox.h"
#include <errno.h>
#include <unistd.h>
+#include <stdlib.h>
int readlink_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
#include <errno.h>
+#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
extern int reset_main(int argc, char **argv)
{
#include <utime.h>
#include <dirent.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
static int recursiveFlag = FALSE;
static int forceFlag = FALSE;
#include "busybox.h"
#include <stdio.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int rmdir_main(int argc, char **argv)
{
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
+#include <stdlib.h>
+#include <sys/syscall.h>
+#include <linux/unistd.h>
#define __LIBRARY__
#include "busybox.h"
#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
/*
* Some general definitions
#include <string.h> /* for strdup() */
#include <errno.h>
#include <ctype.h> /* for isspace() */
+#include <stdlib.h>
#include "busybox.h"
/* externs */
+extern void xregcomp(regex_t *preg, const char *regex, int cflags);
extern int optind; /* in unistd.h */
extern char *optarg; /* ditto */
#include "busybox.h"
#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int sleep_main(int argc, char **argv)
{
*/
#include "busybox.h"
+#include <getopt.h>
+#include <stdlib.h>
int compare_ascii(const void *x, const void *y)
{
#include "busybox.h"
#include <stdio.h>
-#include <sys/mount.h>
#include <mntent.h>
#include <dirent.h>
#include <errno.h>
+#include <stdlib.h>
+#include <sys/mount.h>
+#include <sys/syscall.h>
+#include <linux/unistd.h>
_syscall2(int, swapon, const char *, path, int, flags);
_syscall1(int, swapoff, const char *, path);
#include "busybox.h"
#include <stdio.h>
+#include <unistd.h>
extern int sync_main(int argc, char **argv)
{
#include <sys/types.h>
#include <fcntl.h>
#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
#if !defined BB_SYSLOGD
#include <signal.h>
#include <stdarg.h>
#include <time.h>
+#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/param.h>
#if ! defined __GLIBC__ && ! defined __UCLIBC__
-
+#include <sys/syscall.h>
+#include <linux/unistd.h>
typedef unsigned int socklen_t;
#ifndef __alpha__
#include <signal.h>
#include <stdarg.h>
#include <time.h>
+#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/param.h>
#if ! defined __GLIBC__ && ! defined __UCLIBC__
-
+#include <sys/syscall.h>
+#include <linux/unistd.h>
typedef unsigned int socklen_t;
#ifndef __alpha__
#include "busybox.h"
-#include <sys/types.h>
#include <fcntl.h>
+#include <getopt.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
static struct suffix_mult tail_suffixes[] = {
{ "b", 512 },
#include <sys/sysmacros.h>
#include <getopt.h>
#include <fnmatch.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
#ifdef BB_FEATURE_TAR_GZIP
extern int unzip(int in, int out);
#include <fcntl.h>
#include <utime.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int touch_main(int argc, char **argv)
{
map(input, input_length, output, output_length);
}
for (i = 0; i < input_length; i++)
- invec[input[i]] = TRUE;
+ invec[(int)input[i]] = TRUE;
for (i = 0; i < output_length; i++)
- outvec[output[i]] = TRUE;
+ outvec[(int)output[i]] = TRUE;
}
convert();
return (0);
*/
#include "busybox.h"
+#include <stdlib.h>
extern int true_main(int argc, char **argv)
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <sys/types.h>
extern int tty_main(int argc, char **argv)
#include <stdio.h>
#include <mntent.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
static const int MNT_FORCE = 1;
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include "busybox.h"
#include <stdio.h>
#include <string.h>
+#include <getopt.h>
#include <errno.h>
+#include <stdlib.h>
static int print_count;
static int print_uniq = 1;
#include <sys/param.h>
#include <sys/syslog.h>
#include <unistd.h> /* for getopt() */
+#include <stdlib.h>
#if defined(__GLIBC__)
#include <sys/kdaemon.h>
#else
+#include <sys/syscall.h>
+#include <linux/unistd.h>
static _syscall2(int, bdflush, int, func, int, data);
#endif /* __GLIBC__ */
#include <stdio.h>
#include <time.h>
#include <errno.h>
+#include <stdlib.h>
static const int FSHIFT = 16; /* nr of bits of precision */
#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
+#include <getopt.h>
#if __GNU_LIBRARY__ < 5
-
+#include <sys/syscall.h>
+#include <linux/unistd.h>
#ifndef __alpha__
# define __NR_klogctl __NR_syslog
static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
+#include <string.h>
#include <sys/ioctl.h>
#define DEFAULTFBDEV "/dev/fb0"
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
+#include <stdlib.h>
/* From <linux/fd.h> */
#define FDFLUSH _IO(2,0x4b)
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
+#include <stdlib.h>
#include "busybox.h"
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
#define BB_DECLARE_EXTERN
#define bb_need_help
#include <netdb.h>
#include <stdio.h>
#include <getopt.h>
+#include <stdlib.h>
+#include <unistd.h>
static const int RFC_868_BIAS = 2208988800UL;
#include "busybox.h"
#include <stdio.h>
-#include <sys/mount.h>
#include <mntent.h>
#include <dirent.h>
#include <errno.h>
+#include <stdlib.h>
+#include <sys/mount.h>
+#include <sys/syscall.h>
+#include <linux/unistd.h>
_syscall2(int, swapon, const char *, path, int, flags);
_syscall1(int, swapoff, const char *, path);
#include <stdio.h>
#include <mntent.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
static const int MNT_FORCE = 1;
#include <utime.h>
#include <unistd.h>
#include <ctype.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/utsname.h> /* for uname(2) */
+
#include "pwd_grp/pwd.h"
#include "pwd_grp/grp.h"
+/* for the _syscall() macros */
+#include <sys/syscall.h>
+#include <linux/unistd.h>
+
/* Busybox mount uses either /proc/filesystems or /dev/mtab to get the
* list of available filesystems used for the -t auto option */
#if defined BB_FEATURE_USE_PROCFS && defined BB_FEATURE_USE_DEVPS_PATCH
#if defined BB_DF || defined BB_MTAB
+#include <mntent.h>
/*
* Given a block device, find the mount table entry if that block device
* is mounted.
#endif
#if defined BB_GREP || defined BB_SED
+#include <regex.h>
void xregcomp(regex_t *preg, const char *regex, int cflags)
{
int ret;
#include <stdio.h>
#include <errno.h>
#include <getopt.h>
+#include <string.h>
+#include <stdlib.h>
+#include "pwd_grp/pwd.h"
+#include "pwd_grp/grp.h"
/*struct passwd *getpwnam();*/
#include <stdio.h>
#include <errno.h>
#include <getopt.h>
+#include <stdlib.h>
#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
#include "busybox.h"
#include <stdio.h>
#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
extern int watchdog_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
#include <getopt.h>
+#include <stdlib.h>
static int total_lines, total_words, total_chars, max_length;
static int print_lines, print_words, print_chars, print_length;
#include <arpa/inet.h>
#include <netdb.h>
+/* Stupid libc5 doesn't define this... */
+#ifndef timersub
+#define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif
void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
FILE *open_socket(char *host, int port);
int fd;
FILE *fp;
- memzero(&sin, sizeof(sin));
+ memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
if ((hp = (struct hostent *) gethostbyname(host)) == NULL)
error_msg_and_die("cannot resolve %s\n", host);
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wget.c,v 1.22 2001/01/26 02:04:49 andersen Exp $
+ * $Id: wget.c,v 1.23 2001/01/27 08:24:38 andersen Exp $
*/
*/
#include "busybox.h"
+#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
extern int which_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
extern int whoami_main(int argc, char **argv)
{
#include "busybox.h"
#include <stdio.h>
+#include <stdlib.h>
extern int yes_main(int argc, char **argv)
{