@@ -2,7 +2,6 @@
#include <unistd.h>
#include "../include/autoconf.h"
-#include "../include/busybox.h"
static const char usage_messages[] = ""
#define MAKE_USAGE
@@ -14,7 +14,7 @@
* http://www.unix-systems.org/single_unix_specification_v2/xcu/ar.html
*/
-#include "busybox.h"
+#include "libbb.h"
#include "unarchive.h"
static void header_verbose_list_ar(const file_header_t *file_header)
@@ -5,7 +5,7 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
enum {
@@ -16,7 +16,7 @@
#include <string.h>
#define CPIO_OPT_EXTRACT 0x01
#define CPIO_OPT_TEST 0x02
@@ -24,7 +24,7 @@
*
/* note: if you vary hash_prime sizes be aware,
@@ -4,7 +4,7 @@
#define DPKG_DEB_OPT_CONTENTS 1
@@ -39,7 +39,7 @@ gzip: bogus: No such file or directory
aa: 85.1% -- replaced with aa.gz
/* ===========================================================================
@@ -7,7 +7,7 @@
#define RPM_HEADER_MAGIC "\216\255\350"
@@ -6,7 +6,7 @@
#define RPM_MAGIC "\355\253\356\333"
@@ -25,7 +25,7 @@
#include <fnmatch.h>
#include <getopt.h>
#if ENABLE_FEATURE_TAR_CREATE
* - central directory
#define ZIP_FILEHEADER_MAGIC SWAP_LE32(0x04034b50)
/* From <linux/vt.h> */
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
int clear_main(int argc, char **argv);
@@ -10,7 +10,7 @@
/* no options, no getopt */
enum { VT_DISALLOCATE = 0x5608 }; /* free memory associated to vt */
@@ -8,7 +8,7 @@
/* From <linux/kd.h> */
struct kbentry {
* Loads the console font, and possibly the corresponding screen map(s).
* (Adapted for busybox by Matej Vela.)
#include <sys/kd.h>
#define BINARY_KEYMAP_MAGIC "bkeymap"
/* getopt not needed */
int openvt_main(int argc, char **argv);
int openvt_main(int argc, char **argv)
@@ -13,7 +13,7 @@
int reset_main(int argc, char **argv);
int reset_main(int argc, char **argv)
#define ESC "\033"
#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
static const struct option setconsole_long_options[] = {
#include <sys/ioctl.h>
@@ -9,7 +9,7 @@
int setlogcons_main(int argc, char **argv);
int setlogcons_main(int argc, char **argv)
@@ -20,7 +20,7 @@
* 3) Save some space by using strcmp(). Calling strncmp() here was silly.
/* This is a NOFORK applet. Be very careful! */
@@ -17,7 +17,7 @@
* Major size reduction... over 50% (>1.5k) on i386.
#define THURSDAY 4 /* for reformation */
#define SATURDAY 6 /* 1 Jan 1 was a Saturday */
/* BB_AUDIT SUSv3 compliant */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */
/* See "Cat -v considered harmful" at
* http://cm.bell-labs.com/cm/cs/doc/84/kp.ps.gz */
int catv_main(int argc, char **argv);
int catv_main(int argc, char **argv)
@@ -11,7 +11,7 @@
/* BB_AUDIT GNU defects - unsupported long options. */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/chgrp.html */
/* This is a NOEXEC applet. Be very careful! */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/chmod.html */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */
/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */
int chroot_main(int argc, char **argv);
int chroot_main(int argc, char **argv)
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */
int cksum_main(int argc, char **argv);
int cksum_main(int argc, char **argv)
@@ -21,7 +21,7 @@
* in the '-l' case.
static FILE *cmp_xfopen_input(const char *filename)
{
#define COMM_OPT_1 (1 << 0)
#define COMM_OPT_2 (1 << 1)
@@ -15,7 +15,7 @@
* Size reduction.
#include "libcoreutils/coreutils.h"
/* This 'date' command supports only 2 time setting formats,
all the GNU strftime stuff (its in libc, lets use it),
#include <signal.h> /* For FEATURE_DD_SIGNAL_HANDLING */
#include <mntent.h>
#include <sys/vfs.h>
#ifndef CONFIG_FEATURE_HUMAN_READABLE
static long kscale(long b, long bs)
#define FSIZE_MAX 32768
/* http://www.opengroup.org/onlinepubs/007904975/utilities/dirname.html */
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
enum ConvType {
CT_UNIX2DOS = 1,
@@ -23,7 +23,7 @@
* 4) Fixed busybox bug #1284 involving long overflow with human_readable.
#if ENABLE_FEATURE_HUMAN_READABLE
# if ENABLE_FEATURE_DU_DEFAULT_BLOCKSIZE_1K
* The previous version did not allow 4-digit octals.
int bb_echo(char **argv)
@@ -29,11 +29,11 @@
* - use xfunc_error_retval
-#include <errno.h>
#include <getopt.h> /* struct option */
extern char **environ;
+
#if ENABLE_FEATURE_ENV_LONG_OPTIONS
static const struct option env_long_options[] = {
{ "ignore-environment", 0, NULL, 'i' },
/* no getopt needed */
#include "xregex.h"
/* The kinds of value we can have. */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/false.html */
Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
static unsigned long flags;
#define FLAG_COUNT_BYTES 1
/* BB_AUDIT GNU compatible -c, -q, and -v options in 'fancy' configuration. */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/head.html */
static const char head_opts[] =
"n:"
* -Z option support: by Yuichi Nakamura <ynakam@hitachisoft.jp>
#include <sys/types.h>
@@ -9,11 +9,12 @@
* owner/group, will probably modify bb_make_directory(...)
-#include "libcoreutils/coreutils.h"
#include <libgen.h>
+#include "libcoreutils/coreutils.h"
#if ENABLE_FEATURE_INSTALL_LONG_OPTIONS
static const struct option install_long_options[] = {
{ "directory", 0, NULL, 'd' },
@@ -2,7 +2,7 @@
/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */
/* BB_AUDIT GNU options missing: -d, -F, -i, and -v. */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/ln.html */
* a diagnostic message and an error return.
@@ -30,7 +30,7 @@
typedef enum { HASH_SHA1, HASH_MD5 } hash_algo_t;
/* http://www.opengroup.org/onlinepubs/007904975/utilities/mkfifo.html */
int mkfifo_main(int argc, char **argv);
#include <sys/sysmacros.h> // For makedev
static const char modes_chars[] = { 'p', 'c', 'u', 'b', 0, 1, 1, 2 };
#include <errno.h>
#if ENABLE_FEATURE_MV_LONG_OPTIONS
#include <sys/resource.h>
int nice_main(int argc, char **argv);
int nice_main(int argc, char **argv)
int nohup_main(int argc, char **argv);
int nohup_main(int argc, char **argv)
#if ENABLE_DESKTOP
/* This one provides -t (busybox's own build script needs it) */
#include "od_bloaty.c"
@@ -49,8 +49,7 @@ diff -u -a std bbox >bbox.diff || { echo Different!; sleep 1; }
-
#define assert(a) ((void)0)
int printenv_main(int argc, char **argv);
@@ -38,7 +38,7 @@
// 19990508 Busy Boxed! Dave Cinege
typedef void (*converter)(const char *arg, void *result);
int realpath_main(int argc, char **argv);
int realpath_main(int argc, char **argv)
/* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */
* Licensed under the GPL v2, see the file LICENSE in this tarball.
@@ -18,7 +18,7 @@
* time suffixes for seconds, minutes, hours, and days.
* http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html
* SUSv3 requirements:
* http://www.opengroup.org/onlinepubs/009695399/utilities/split.html
static const struct suffix_mult split_suffices[] = {
#if ENABLE_FEATURE_SPLIT_FANCY
/* vars to control behavior */
#define OPT_FILESYS (1<<0)
#ifndef _POSIX_VDISABLE
# define _POSIX_VDISABLE ((unsigned char) 0)
enum { SUM_BSD, PRINT_NAME, SUM_SYSV };
* 7) lseek attempted when count==0 even if arg was +0 (from top)
static const struct suffix_mult tail_suffixes[] = {
{ "b", 512 },
/* http://www.opengroup.org/onlinepubs/007904975/utilities/tee.html */
#include <signal.h>
int tee_main(int argc, char **argv);
* "This program is in the Public Domain."
#include <setjmp.h>
* Also, exiting on a failure was a bug. All args should be processed.
/* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html
* TODO: xdigit, graph, print
#define ASCII 0377
/* http://www.opengroup.org/onlinepubs/007904975/utilities/true.html */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/tty.html */
int tty_main(int argc, char **argv);
int tty_main(int argc, char **argv)
@@ -37,7 +37,7 @@
#include <sys/utsname.h>
typedef struct {
struct utsname name;
/* http://www.opengroup.org/onlinepubs/007904975/utilities/uniq.html */
static const char uniq_opts[] = "cdu" "f:s:" "cdu\0\1\2\4";
/* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */
static void read_stduu(FILE *src_stream, FILE *dst_stream)
#define SRC_BUF_SIZE 45 // This *MUST* be a multiple of 3
/* BB_AUDIT SUSv3 N/A */
/* BB_AUDIT GNU defects -- only option -n is supported. */
// procps 2.0.18:
// watch [-d] [-n seconds]
@@ -41,7 +41,7 @@
* for which 'wc -c' should output '0'.
#ifdef CONFIG_LOCALE_SUPPORT
#define isspace_given_isprint(c) isspace(c)
*----------------------------------------------------------------------
#include <utmp.h>
#include <time.h>
* Size reductions and removed redundant applet name prefix from error messages.
@@ -7,12 +7,10 @@
* Licensed under GPL v2 or later, see file LICENSE in this tarball for details.
-#include <unistd.h>
-#include <stdlib.h>
int readlink_main(int argc, char **argv);
int readlink_main(int argc, char **argv)
@@ -30,10 +30,10 @@
* -u MASK umask. Set the umask of the program executed to MASK.
#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
static const struct option runparts_long_options[] = {
{ "arg", 1, NULL, 'a' },