Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 2 | #include "internal.h" |
| 3 | #include <stdio.h> |
| 4 | #include <string.h> |
| 5 | #include <errno.h> |
| 6 | |
| 7 | static int been_there_done_that = 0; |
| 8 | |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 9 | /* It has been alledged that doing such things can |
| 10 | * help reduce binary size when staticly linking, |
| 11 | * of course with glibc, this is unlikely as long |
| 12 | * as we use things like printf -- perhaps a printf |
| 13 | * replacement may be in order |
| 14 | */ |
Erik Andersen | 05df239 | 2000-01-13 04:43:48 +0000 | [diff] [blame] | 15 | #if 0 |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 16 | void exit(int status) __attribute__ ((noreturn)); |
| 17 | void exit(int status) |
| 18 | { |
| 19 | _exit(status); |
| 20 | }; |
| 21 | void abort(void) __attribute__ ((__noreturn__)); |
| 22 | void abort(void) |
| 23 | { |
| 24 | _exit(0); |
| 25 | }; |
| 26 | int atexit(void (*__func) (void)) |
| 27 | { |
| 28 | _exit(0); |
| 29 | }; |
Erik Andersen | 05df239 | 2000-01-13 04:43:48 +0000 | [diff] [blame] | 30 | void *__libc_stack_end; |
| 31 | #endif |
| 32 | |
Erik Andersen | bcd6177 | 2000-05-13 06:33:19 +0000 | [diff] [blame] | 33 | const struct BB_applet applets[] = { |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 34 | |
Eric Andersen | 86ab8a3 | 2000-06-02 03:21:42 +0000 | [diff] [blame^] | 35 | #ifdef BB_AR |
| 36 | {"ar", ar_main, _BB_DIR_USR_BIN}, |
| 37 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 38 | #ifdef BB_BASENAME |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 39 | {"basename", basename_main, _BB_DIR_USR_BIN}, |
Erik Andersen | e272915 | 2000-02-18 21:34:17 +0000 | [diff] [blame] | 40 | #endif |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 41 | {"busybox", busybox_main, _BB_DIR_BIN}, |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 42 | #ifdef BB_BLOCK_DEVICE |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 43 | {"block_device", block_device_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 44 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 45 | #ifdef BB_CAT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 46 | {"cat", cat_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 47 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 48 | #ifdef BB_CHMOD_CHOWN_CHGRP |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 49 | {"chgrp", chmod_chown_chgrp_main, _BB_DIR_BIN}, |
| 50 | #endif |
| 51 | #ifdef BB_CHMOD_CHOWN_CHGRP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 52 | {"chmod", chmod_chown_chgrp_main, _BB_DIR_BIN}, |
| 53 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 54 | #ifdef BB_CHMOD_CHOWN_CHGRP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 55 | {"chown", chmod_chown_chgrp_main, _BB_DIR_BIN}, |
| 56 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 57 | #ifdef BB_CHROOT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 58 | {"chroot", chroot_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 59 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 60 | #ifdef BB_CLEAR |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 61 | {"clear", clear_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 62 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 63 | #ifdef BB_CHVT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 64 | {"chvt", chvt_main, _BB_DIR_USR_BIN}, |
Eric Andersen | abc0f4f | 1999-12-08 23:19:36 +0000 | [diff] [blame] | 65 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 66 | #ifdef BB_CP_MV |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 67 | {"cp", cp_mv_main, _BB_DIR_BIN}, |
| 68 | #endif |
Erik Andersen | 7ab9c7e | 2000-05-12 19:41:47 +0000 | [diff] [blame] | 69 | #ifdef BB_CUT |
| 70 | {"cut", cut_main, _BB_DIR_USR_BIN}, |
| 71 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 72 | #ifdef BB_DATE |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 73 | {"date", date_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 74 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 75 | #ifdef BB_DD |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 76 | {"dd", dd_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 77 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 78 | #ifdef BB_DF |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 79 | {"df", df_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 80 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 81 | #ifdef BB_DIRNAME |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 82 | {"dirname", dirname_main, _BB_DIR_USR_BIN}, |
Erik Andersen | fb002d0 | 2000-03-05 08:07:00 +0000 | [diff] [blame] | 83 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 84 | #ifdef BB_DMESG |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 85 | {"dmesg", dmesg_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 86 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 87 | #ifdef BB_DU |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 88 | {"du", du_main, _BB_DIR_BIN}, |
John Beppu | 7a98606 | 1999-12-09 18:29:29 +0000 | [diff] [blame] | 89 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 90 | #ifdef BB_DUTMP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 91 | {"dutmp", dutmp_main, _BB_DIR_USR_SBIN}, |
| 92 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 93 | #ifdef BB_ECHO |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 94 | {"echo", echo_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 95 | #endif |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 96 | #ifdef BB_TRUE_FALSE |
| 97 | {"false", false_main, _BB_DIR_BIN}, |
| 98 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 99 | #ifdef BB_FBSET |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 100 | {"fbset", fbset_main, _BB_DIR_USR_SBIN}, |
Erik Andersen | 1c5b258 | 1999-12-16 20:59:36 +0000 | [diff] [blame] | 101 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 102 | #ifdef BB_FDFLUSH |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 103 | {"fdflush", fdflush_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 104 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 105 | #ifdef BB_FIND |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 106 | {"find", find_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 107 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 108 | #ifdef BB_FREE |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 109 | {"free", free_main, _BB_DIR_USR_BIN}, |
Eric Andersen | 0460ff2 | 1999-10-25 23:32:44 +0000 | [diff] [blame] | 110 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 111 | #ifdef BB_FREERAMDISK |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 112 | {"freeramdisk", freeramdisk_main, _BB_DIR_SBIN}, |
Erik Andersen | 6437170 | 2000-03-04 22:23:27 +0000 | [diff] [blame] | 113 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 114 | #ifdef BB_DEALLOCVT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 115 | {"deallocvt", deallocvt_main, _BB_DIR_USR_BIN}, |
Eric Andersen | 0460ff2 | 1999-10-25 23:32:44 +0000 | [diff] [blame] | 116 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 117 | #ifdef BB_FSCK_MINIX |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 118 | {"fsck.minix", fsck_minix_main, _BB_DIR_SBIN}, |
Eric Andersen | e494fdd | 1999-10-19 20:23:03 +0000 | [diff] [blame] | 119 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 120 | #ifdef BB_GREP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 121 | {"grep", grep_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 122 | #endif |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 123 | #ifdef BB_GUNZIP |
| 124 | {"gunzip", gunzip_main, _BB_DIR_BIN}, |
| 125 | #endif |
| 126 | #ifdef BB_GZIP |
| 127 | {"gzip", gzip_main, _BB_DIR_BIN}, |
| 128 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 129 | #ifdef BB_HALT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 130 | {"halt", halt_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 131 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 132 | #ifdef BB_HEAD |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 133 | {"head", head_main, _BB_DIR_BIN}, |
John Beppu | 3157b1f | 1999-12-10 07:42:50 +0000 | [diff] [blame] | 134 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 135 | #ifdef BB_HOSTID |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 136 | {"hostid", hostid_main, _BB_DIR_USR_BIN}, |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 137 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 138 | #ifdef BB_HOSTNAME |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 139 | {"hostname", hostname_main, _BB_DIR_BIN}, |
Eric Andersen | 485b955 | 1999-12-07 23:14:59 +0000 | [diff] [blame] | 140 | #endif |
Erik Andersen | 94f5e0b | 2000-05-01 19:10:52 +0000 | [diff] [blame] | 141 | #ifdef BB_ID |
| 142 | {"id", id_main, _BB_DIR_USR_BIN}, |
| 143 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 144 | #ifdef BB_INIT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 145 | {"init", init_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 146 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 147 | #ifdef BB_INSMOD |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 148 | {"insmod", insmod_main, _BB_DIR_SBIN}, |
Erik Andersen | 6da0ae8 | 1999-12-17 01:08:27 +0000 | [diff] [blame] | 149 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 150 | #ifdef BB_KILL |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 151 | {"kill", kill_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 152 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 153 | #ifdef BB_KILLALL |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 154 | {"killall", kill_main, _BB_DIR_USR_BIN}, |
Erik Andersen | 246cc6d | 2000-03-07 07:41:42 +0000 | [diff] [blame] | 155 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 156 | #ifdef BB_LENGTH |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 157 | {"length", length_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 158 | #endif |
Erik Andersen | 9a8195c | 2000-04-18 23:32:10 +0000 | [diff] [blame] | 159 | #ifdef BB_LINUXRC |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 160 | {"linuxrc", init_main, _BB_DIR_ROOT}, |
| 161 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 162 | #ifdef BB_LN |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 163 | {"ln", ln_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 164 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 165 | #ifdef BB_LOADACM |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 166 | {"loadacm", loadacm_main, _BB_DIR_USR_BIN}, |
Eric Andersen | 3e0fbae | 1999-10-19 06:02:44 +0000 | [diff] [blame] | 167 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 168 | #ifdef BB_LOADFONT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 169 | {"loadfont", loadfont_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 170 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 171 | #ifdef BB_LOADKMAP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 172 | {"loadkmap", loadkmap_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 173 | #endif |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 174 | #ifdef BB_LOGGER |
| 175 | {"logger", logger_main, _BB_DIR_USR_BIN}, |
| 176 | #endif |
| 177 | #ifdef BB_LOGNAME |
| 178 | {"logname", logname_main, _BB_DIR_USR_BIN}, |
| 179 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 180 | #ifdef BB_LS |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 181 | {"ls", ls_main, _BB_DIR_BIN}, |
Erik Andersen | 6f23cec | 1999-12-15 22:14:12 +0000 | [diff] [blame] | 182 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 183 | #ifdef BB_LSMOD |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 184 | {"lsmod", lsmod_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 185 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 186 | #ifdef BB_MAKEDEVS |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 187 | {"makedevs", makedevs_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 188 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 189 | #ifdef BB_MATH |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 190 | {"math", math_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 191 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 192 | #ifdef BB_MKDIR |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 193 | {"mkdir", mkdir_main, _BB_DIR_BIN}, |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 194 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 195 | #ifdef BB_MKFIFO |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 196 | {"mkfifo", mkfifo_main, _BB_DIR_USR_BIN}, |
Eric Andersen | 19db07b | 1999-12-11 08:41:28 +0000 | [diff] [blame] | 197 | #endif |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 198 | #ifdef BB_MKFS_MINIX |
| 199 | {"mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN}, |
| 200 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 201 | #ifdef BB_MKNOD |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 202 | {"mknod", mknod_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 203 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 204 | #ifdef BB_MKSWAP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 205 | {"mkswap", mkswap_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 206 | #endif |
Erik Andersen | 227a59b | 2000-04-25 23:24:55 +0000 | [diff] [blame] | 207 | #ifdef BB_MKTEMP |
| 208 | {"mktemp", mktemp_main, _BB_DIR_BIN}, |
| 209 | #endif |
Erik Andersen | 7ab9c7e | 2000-05-12 19:41:47 +0000 | [diff] [blame] | 210 | #ifdef BB_NC |
| 211 | {"nc", nc_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 212 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 213 | #ifdef BB_MORE |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 214 | {"more", more_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 215 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 216 | #ifdef BB_MOUNT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 217 | {"mount", mount_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 218 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 219 | #ifdef BB_MT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 220 | {"mt", mt_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 221 | #endif |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 222 | #ifdef BB_CP_MV |
| 223 | {"mv", cp_mv_main, _BB_DIR_BIN}, |
| 224 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 225 | #ifdef BB_NSLOOKUP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 226 | {"nslookup", nslookup_main, _BB_DIR_USR_BIN}, |
John Beppu | b332e77 | 2000-01-29 12:59:01 +0000 | [diff] [blame] | 227 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 228 | #ifdef BB_PING |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 229 | {"ping", ping_main, _BB_DIR_BIN}, |
Eric Andersen | 485b955 | 1999-12-07 23:14:59 +0000 | [diff] [blame] | 230 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 231 | #ifdef BB_POWEROFF |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 232 | {"poweroff", poweroff_main, _BB_DIR_SBIN}, |
Eric Andersen | 2cb5507 | 1999-12-10 08:25:07 +0000 | [diff] [blame] | 233 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 234 | #ifdef BB_PRINTF |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 235 | {"printf", printf_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 236 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 237 | #ifdef BB_PS |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 238 | {"ps", ps_main, _BB_DIR_BIN}, |
Eric Andersen | ef8b6c7 | 1999-10-20 08:05:35 +0000 | [diff] [blame] | 239 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 240 | #ifdef BB_PWD |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 241 | {"pwd", pwd_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 242 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 243 | #ifdef BB_REBOOT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 244 | {"reboot", reboot_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 245 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 246 | #ifdef BB_RM |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 247 | {"rm", rm_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 248 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 249 | #ifdef BB_RMDIR |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 250 | {"rmdir", rmdir_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 251 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 252 | #ifdef BB_RMMOD |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 253 | {"rmmod", rmmod_main, _BB_DIR_SBIN}, |
Erik Andersen | 3d7e341 | 1999-12-16 23:04:20 +0000 | [diff] [blame] | 254 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 255 | #ifdef BB_SED |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 256 | {"sed", sed_main, _BB_DIR_BIN}, |
Erik Andersen | 3522eb1 | 2000-03-12 23:49:18 +0000 | [diff] [blame] | 257 | #endif |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 258 | #ifdef BB_SETKEYCODES |
| 259 | {"setkeycodes", setkeycodes_main, _BB_DIR_USR_BIN}, |
Erik Andersen | 3522eb1 | 2000-03-12 23:49:18 +0000 | [diff] [blame] | 260 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 261 | #ifdef BB_SFDISK |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 262 | {"sfdisk", sfdisk_main, _BB_DIR_SBIN}, |
Eric Andersen | e77ae3a | 1999-10-19 20:03:34 +0000 | [diff] [blame] | 263 | #endif |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 264 | #ifdef BB_SH |
| 265 | {"sh", shell_main, _BB_DIR_BIN}, |
| 266 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 267 | #ifdef BB_SLEEP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 268 | {"sleep", sleep_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 269 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 270 | #ifdef BB_SORT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 271 | {"sort", sort_main, _BB_DIR_BIN}, |
John Beppu | 019513a | 1999-12-22 17:57:31 +0000 | [diff] [blame] | 272 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 273 | #ifdef BB_SYNC |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 274 | {"sync", sync_main, _BB_DIR_BIN}, |
Eric Andersen | 3843e96 | 1999-11-25 07:30:46 +0000 | [diff] [blame] | 275 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 276 | #ifdef BB_SYSLOGD |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 277 | {"syslogd", syslogd_main, _BB_DIR_SBIN}, |
Eric Andersen | 3843e96 | 1999-11-25 07:30:46 +0000 | [diff] [blame] | 278 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 279 | #ifdef BB_SWAPONOFF |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 280 | {"swapon", swap_on_off_main, _BB_DIR_SBIN}, |
| 281 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 282 | #ifdef BB_SWAPONOFF |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 283 | {"swapoff", swap_on_off_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 284 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 285 | #ifdef BB_TAIL |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 286 | {"tail", tail_main, _BB_DIR_USR_BIN}, |
Eric Andersen | abc0f4f | 1999-12-08 23:19:36 +0000 | [diff] [blame] | 287 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 288 | #ifdef BB_TAR |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 289 | {"tar", tar_main, _BB_DIR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 290 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 291 | #ifdef BB_TELNET |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 292 | {"telnet", telnet_main, _BB_DIR_USR_BIN}, |
| 293 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 294 | #ifdef BB_TEST |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 295 | {"test", test_main, _BB_DIR_USR_BIN}, |
Erik Andersen | f7c49ef | 2000-02-22 17:17:45 +0000 | [diff] [blame] | 296 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 297 | #ifdef BB_TEE |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 298 | {"tee", tee_main, _BB_DIR_BIN}, |
John Beppu | 059f152 | 1999-12-10 05:27:16 +0000 | [diff] [blame] | 299 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 300 | #ifdef BB_TOUCH |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 301 | {"touch", touch_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 302 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 303 | #ifdef BB_TR |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 304 | {"tr", tr_main, _BB_DIR_USR_BIN}, |
Erik Andersen | fb002d0 | 2000-03-05 08:07:00 +0000 | [diff] [blame] | 305 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 306 | #ifdef BB_TRUE_FALSE |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 307 | {"true", true_main, _BB_DIR_BIN}, |
| 308 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 309 | #ifdef BB_TTY |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 310 | {"tty", tty_main, _BB_DIR_USR_BIN}, |
Erik Andersen | 05df239 | 2000-01-13 04:43:48 +0000 | [diff] [blame] | 311 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 312 | #ifdef BB_UMOUNT |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 313 | {"umount", umount_main, _BB_DIR_BIN}, |
Erik Andersen | 66be5e7 | 2000-03-05 07:52:05 +0000 | [diff] [blame] | 314 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 315 | #ifdef BB_UNAME |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 316 | {"uname", uname_main, _BB_DIR_BIN}, |
Eric Andersen | 0460ff2 | 1999-10-25 23:32:44 +0000 | [diff] [blame] | 317 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 318 | #ifdef BB_UNIQ |
Erik Andersen | a6c7522 | 2000-04-18 00:00:52 +0000 | [diff] [blame] | 319 | {"uniq", uniq_main, _BB_DIR_USR_BIN}, |
John Beppu | abb4772 | 2000-01-06 00:48:21 +0000 | [diff] [blame] | 320 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 321 | #ifdef BB_UPDATE |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 322 | {"update", update_main, _BB_DIR_SBIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 323 | #endif |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 324 | #ifdef BB_UPTIME |
| 325 | {"uptime", uptime_main, _BB_DIR_USR_BIN}, |
| 326 | #endif |
Erik Andersen | b99ca13 | 2000-04-04 18:49:18 +0000 | [diff] [blame] | 327 | #ifdef BB_USLEEP |
| 328 | {"usleep", usleep_main, _BB_DIR_BIN}, |
| 329 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 330 | #ifdef BB_WC |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 331 | {"wc", wc_main, _BB_DIR_USR_BIN}, |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 332 | #endif |
Erik Andersen | 330fd2b | 2000-05-19 05:35:19 +0000 | [diff] [blame] | 333 | #ifdef BB_WHICH |
| 334 | {"which", which_main, _BB_DIR_USR_BIN}, |
| 335 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 336 | #ifdef BB_WHOAMI |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 337 | {"whoami", whoami_main, _BB_DIR_USR_BIN}, |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 338 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 339 | #ifdef BB_YES |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 340 | {"yes", yes_main, _BB_DIR_USR_BIN}, |
Erik Andersen | 3163821 | 2000-01-15 22:28:50 +0000 | [diff] [blame] | 341 | #endif |
Erik Andersen | 298854f | 2000-03-23 01:09:18 +0000 | [diff] [blame] | 342 | #ifdef BB_GUNZIP |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 343 | {"zcat", gunzip_main, _BB_DIR_BIN}, |
| 344 | #endif |
Erik Andersen | 5e1189e | 2000-04-15 16:34:54 +0000 | [diff] [blame] | 345 | #ifdef BB_TEST |
| 346 | {"[", test_main, _BB_DIR_USR_BIN}, |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 347 | #endif |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 348 | {0} |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 349 | }; |
| 350 | |
Erik Andersen | 05df239 | 2000-01-13 04:43:48 +0000 | [diff] [blame] | 351 | |
| 352 | |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 353 | int main(int argc, char **argv) |
| 354 | { |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 355 | char *s; |
| 356 | char *name; |
Erik Andersen | bcd6177 | 2000-05-13 06:33:19 +0000 | [diff] [blame] | 357 | const struct BB_applet *a = applets; |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 358 | |
Erik Andersen | d75af99 | 2000-03-16 08:09:09 +0000 | [diff] [blame] | 359 | for (s = name = argv[0]; *s != '\0';) { |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 360 | if (*s++ == '/') |
| 361 | name = s; |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 362 | } |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 363 | |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 364 | *argv = name; |
| 365 | |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 366 | while (a->name != 0) { |
| 367 | if (strcmp(name, a->name) == 0) { |
| 368 | int status; |
| 369 | |
| 370 | status = ((*(a->main)) (argc, argv)); |
| 371 | if (status < 0) { |
| 372 | fprintf(stderr, "%s: %s\n", a->name, strerror(errno)); |
| 373 | } |
| 374 | fprintf(stderr, "\n"); |
| 375 | exit(status); |
| 376 | } |
| 377 | a++; |
| 378 | } |
| 379 | exit(busybox_main(argc, argv)); |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 380 | } |
| 381 | |
| 382 | |
| 383 | int busybox_main(int argc, char **argv) |
| 384 | { |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 385 | int col = 0; |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 386 | |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 387 | argc--; |
| 388 | argv++; |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 389 | |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 390 | if (been_there_done_that == 1 || argc < 1) { |
Erik Andersen | bcd6177 | 2000-05-13 06:33:19 +0000 | [diff] [blame] | 391 | const struct BB_applet *a = applets; |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 392 | |
Erik Andersen | 330fd2b | 2000-05-19 05:35:19 +0000 | [diff] [blame] | 393 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n" |
| 394 | "Usage: busybox [function] [arguments]...\n" |
| 395 | " or: [function] [arguments]...\n\n" |
John Beppu | b4f8606 | 2000-04-13 03:36:01 +0000 | [diff] [blame] | 396 | "\tBusyBox is a multi-call binary that combines many common Unix\n" |
| 397 | "\tutilities into a single executable. Most people will create a\n" |
| 398 | "\tlink to busybox for each function they wish to use, and BusyBox\n" |
Erik Andersen | 330fd2b | 2000-05-19 05:35:19 +0000 | [diff] [blame] | 399 | "\twill act like whatever it was invoked as.\n" |
| 400 | "\nCurrently defined functions:\n", BB_VER, BB_BT); |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 401 | |
| 402 | while (a->name != 0) { |
| 403 | col += |
| 404 | fprintf(stderr, "%s%s", ((col == 0) ? "\t" : ", "), |
| 405 | (a++)->name); |
| 406 | if (col > 60 && a->name != 0) { |
| 407 | fprintf(stderr, ",\n"); |
| 408 | col = 0; |
| 409 | } |
| 410 | } |
| 411 | fprintf(stderr, "\n\n"); |
| 412 | exit(-1); |
| 413 | } else { |
| 414 | /* If we've already been here once, exit now */ |
| 415 | been_there_done_that = 1; |
| 416 | return (main(argc, argv)); |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 417 | } |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 418 | } |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 419 | |
| 420 | /* |
| 421 | Local Variables: |
| 422 | c-file-style: "linux" |
| 423 | c-basic-offset: 4 |
| 424 | tab-width: 4 |
| 425 | End: |
| 426 | */ |