aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.h333
-rw-r--r--include/busybox.h47
-rw-r--r--include/dump.h50
-rw-r--r--include/grp_.h115
-rw-r--r--include/inet_common.h30
-rw-r--r--include/libbb.h689
-rw-r--r--include/platform.h276
-rw-r--r--include/pwd_.h107
-rw-r--r--include/shadow_.h99
-rw-r--r--include/unarchive.h114
-rw-r--r--include/usage.h3495
-rw-r--r--include/xatonum.h157
-rw-r--r--include/xregex.h17
13 files changed, 5529 insertions, 0 deletions
diff --git a/include/applets.h b/include/applets.h
new file mode 100644
index 000000000..d3e38d813
--- /dev/null
+++ b/include/applets.h
@@ -0,0 +1,333 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * applets.h - a listing of all busybox applets.
4 *
5 * If you write a new applet, you need to add an entry to this list to make
6 * busybox aware of it.
7 *
8 * It is CRUCIAL that this listing be kept in ascii order, otherwise the binary
9 * search lookup contributed by Gaute B Strokkenes stops working. If you value
10 * your kneecaps, you'll be sure to *make sure* that any changes made to this
11 * file result in the listing remaining in ascii order. You have been warned.
12 */
13
14#undef APPLET
15#undef APPLET_ODDNAME
16#undef APPLET_NOUSAGE
17
18
19#if defined(PROTOTYPES)
20# define APPLET(a,b,c) extern int a##_main(int argc, char **argv);
21# define APPLET_NOUSAGE(a,b,c,d) extern int b##_main(int argc, char **argv);
22# define APPLET_ODDNAME(a,b,c,d,e) extern int b##_main(int argc, char **argv);
23#elif defined(MAKE_USAGE)
24# ifdef CONFIG_FEATURE_VERBOSE_USAGE
25# define APPLET(a,b,c) a##_trivial_usage "\n\n" a##_full_usage "\0"
26# define APPLET_NOUSAGE(a,b,c,d) "\b\0"
27# define APPLET_ODDNAME(a,b,c,d,e) e##_trivial_usage "\n\n" e##_full_usage "\0"
28# else
29# define APPLET(a,b,c) a##_trivial_usage "\0"
30# define APPLET_NOUSAGE(a,b,c,d) "\b\0"
31# define APPLET_ODDNAME(a,b,c,d,e) e##_trivial_usage "\0"
32# endif
33#elif defined(MAKE_LINKS)
34# define APPLET(a,b,c) LINK b a
35# define APPLET_NOUSAGE(a,b,c,d) LINK c a
36# define APPLET_ODDNAME(a,b,c,d,e) LINK c a
37#else
38 const struct BB_applet applets[] = {
39# define APPLET(a,b,c) {#a,a##_main,b,c},
40# define APPLET_NOUSAGE(a,b,c,d) {#a,b##_main,c,d},
41# define APPLET_ODDNAME(a,b,c,d,e) {#a,b##_main,c,d},
42#endif
43
44#ifdef CONFIG_INSTALL_NO_USR
45# define _BB_DIR_USR_BIN _BB_DIR_BIN
46# define _BB_DIR_USR_SBIN _BB_DIR_SBIN
47#endif
48
49// _BB_SUID_ALWAYS: will complain if busybox isn't suid
50// and is run by non-root (applet_main() will not be called at all)
51// _BB_SUID_NEVER: will drop suid prior to applet_main()
52// _BB_SUID_MAYBE: neither of the above
53
54USE_TEST(APPLET_NOUSAGE([, test, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
55USE_TEST(APPLET_NOUSAGE([[, test, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
56USE_ADDGROUP(APPLET(addgroup, _BB_DIR_BIN, _BB_SUID_NEVER))
57USE_ADDUSER(APPLET(adduser, _BB_DIR_BIN, _BB_SUID_NEVER))
58USE_ADJTIMEX(APPLET(adjtimex, _BB_DIR_SBIN, _BB_SUID_NEVER))
59USE_AR(APPLET(ar, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
60USE_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
61USE_ASH(APPLET_NOUSAGE(ash, ash, _BB_DIR_BIN, _BB_SUID_NEVER))
62USE_AWK(APPLET(awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
63USE_BASENAME(APPLET(basename, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
64USE_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_NEVER))
65//USE_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_NEVER))
66USE_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
67/* Always enabled. */
68APPLET_NOUSAGE(busybox, busybox, _BB_DIR_BIN, _BB_SUID_MAYBE)
69USE_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER, bzcat))
70USE_CAL(APPLET(cal, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
71USE_CAT(APPLET(cat, _BB_DIR_BIN, _BB_SUID_NEVER))
72USE_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_NEVER))
73USE_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_NEVER))
74USE_CHGRP(APPLET(chgrp, _BB_DIR_BIN, _BB_SUID_NEVER))
75USE_CHMOD(APPLET(chmod, _BB_DIR_BIN, _BB_SUID_NEVER))
76USE_CHOWN(APPLET(chown, _BB_DIR_BIN, _BB_SUID_NEVER))
77USE_CHPST(APPLET(chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
78USE_CHROOT(APPLET(chroot, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
79USE_CHVT(APPLET(chvt, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
80USE_CKSUM(APPLET(cksum, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
81USE_CLEAR(APPLET(clear, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
82USE_CMP(APPLET(cmp, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
83USE_COMM(APPLET(comm, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
84USE_CP(APPLET(cp, _BB_DIR_BIN, _BB_SUID_NEVER))
85USE_CPIO(APPLET(cpio, _BB_DIR_BIN, _BB_SUID_NEVER))
86USE_CROND(APPLET(crond, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
87USE_CRONTAB(APPLET(crontab, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
88USE_CUT(APPLET(cut, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
89USE_DATE(APPLET(date, _BB_DIR_BIN, _BB_SUID_NEVER))
90USE_DC(APPLET(dc, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
91USE_DD(APPLET(dd, _BB_DIR_BIN, _BB_SUID_NEVER))
92USE_DEALLOCVT(APPLET(deallocvt, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
93USE_DELGROUP(APPLET_ODDNAME(delgroup, deluser, _BB_DIR_BIN, _BB_SUID_NEVER, delgroup))
94USE_DELUSER(APPLET(deluser, _BB_DIR_BIN, _BB_SUID_NEVER))
95USE_DEVFSD(APPLET(devfsd, _BB_DIR_SBIN, _BB_SUID_NEVER))
96USE_DF(APPLET(df, _BB_DIR_BIN, _BB_SUID_NEVER))
97USE_APP_DHCPRELAY(APPLET(dhcprelay, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
98USE_DIFF(APPLET(diff, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
99USE_DIRNAME(APPLET(dirname, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
100USE_DMESG(APPLET(dmesg, _BB_DIR_BIN, _BB_SUID_NEVER))
101USE_DNSD(APPLET(dnsd, _BB_DIR_USR_SBIN, _BB_SUID_ALWAYS))
102USE_DOS2UNIX(APPLET(dos2unix, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
103USE_DPKG(APPLET(dpkg, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
104USE_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb, _BB_DIR_USR_BIN, _BB_SUID_NEVER, dpkg_deb))
105USE_DU(APPLET(du, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
106USE_DUMPKMAP(APPLET(dumpkmap, _BB_DIR_BIN, _BB_SUID_NEVER))
107USE_APP_DUMPLEASES(APPLET(dumpleases, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
108USE_E2FSCK(APPLET(e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
109USE_E2LABEL(APPLET_NOUSAGE(e2label, tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
110USE_ECHO(APPLET(echo, _BB_DIR_BIN, _BB_SUID_NEVER))
111USE_ED(APPLET(ed, _BB_DIR_BIN, _BB_SUID_NEVER))
112USE_FEATURE_GREP_EGREP_ALIAS(APPLET_NOUSAGE(egrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER))
113USE_EJECT(APPLET(eject, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
114USE_ENV(APPLET(env, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
115USE_ENVDIR(APPLET_ODDNAME(envdir, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envdir))
116USE_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envuidgid))
117USE_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, _BB_DIR_USR_BIN, _BB_SUID_NEVER, ether_wake))
118USE_EXPR(APPLET(expr, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
119USE_FAKEIDENTD(APPLET(fakeidentd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
120USE_FALSE(APPLET(false, _BB_DIR_BIN, _BB_SUID_NEVER))
121USE_FBSET(APPLET(fbset, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
122USE_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, _BB_DIR_BIN, _BB_SUID_NEVER, fdflush))
123USE_FDFORMAT(APPLET(fdformat, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
124USE_FDISK(APPLET(fdisk, _BB_DIR_SBIN, _BB_SUID_NEVER))
125USE_FEATURE_GREP_FGREP_ALIAS(APPLET_NOUSAGE(fgrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER))
126USE_FIND(APPLET(find, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
127USE_FINDFS(APPLET_NOUSAGE(findfs, tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
128USE_FOLD(APPLET(fold, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
129USE_FREE(APPLET(free, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
130USE_FREERAMDISK(APPLET(freeramdisk, _BB_DIR_SBIN, _BB_SUID_NEVER))
131USE_FSCK(APPLET(fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
132USE_E2FSCK(APPLET_NOUSAGE(fsck.ext2, e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
133USE_E2FSCK(APPLET_NOUSAGE(fsck.ext3, e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER))
134USE_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, fsck_minix))
135USE_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, _BB_DIR_USR_BIN, _BB_SUID_NEVER,ftpget))
136USE_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, _BB_DIR_USR_BIN, _BB_SUID_NEVER,ftpput))
137USE_FUSER(APPLET(fuser, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
138USE_GETOPT(APPLET(getopt, _BB_DIR_BIN, _BB_SUID_NEVER))
139USE_GETTY(APPLET(getty, _BB_DIR_SBIN, _BB_SUID_NEVER))
140USE_GREP(APPLET(grep, _BB_DIR_BIN, _BB_SUID_NEVER))
141USE_GUNZIP(APPLET(gunzip, _BB_DIR_BIN, _BB_SUID_NEVER))
142USE_GZIP(APPLET(gzip, _BB_DIR_BIN, _BB_SUID_NEVER))
143USE_HALT(APPLET(halt, _BB_DIR_SBIN, _BB_SUID_NEVER))
144USE_HDPARM(APPLET(hdparm, _BB_DIR_SBIN, _BB_SUID_NEVER))
145USE_HEAD(APPLET(head, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
146USE_HEXDUMP(APPLET(hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
147USE_HOSTID(APPLET(hostid, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
148USE_HOSTNAME(APPLET(hostname, _BB_DIR_BIN, _BB_SUID_NEVER))
149USE_HTTPD(APPLET(httpd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
150USE_HUSH(APPLET_NOUSAGE(hush, hush, _BB_DIR_BIN, _BB_SUID_NEVER))
151USE_HWCLOCK(APPLET(hwclock, _BB_DIR_SBIN, _BB_SUID_NEVER))
152USE_ID(APPLET(id, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
153USE_IFCONFIG(APPLET(ifconfig, _BB_DIR_SBIN, _BB_SUID_NEVER))
154USE_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, _BB_DIR_SBIN, _BB_SUID_NEVER, ifdown))
155USE_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, _BB_DIR_SBIN, _BB_SUID_NEVER, ifup))
156USE_INETD(APPLET(inetd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
157USE_INIT(APPLET(init, _BB_DIR_SBIN, _BB_SUID_NEVER))
158USE_INSMOD(APPLET(insmod, _BB_DIR_SBIN, _BB_SUID_NEVER))
159USE_INSTALL(APPLET(install, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
160USE_IP(APPLET(ip, _BB_DIR_BIN, _BB_SUID_NEVER))
161USE_IPADDR(APPLET(ipaddr, _BB_DIR_BIN, _BB_SUID_NEVER))
162USE_IPCALC(APPLET(ipcalc, _BB_DIR_BIN, _BB_SUID_NEVER))
163USE_IPCRM(APPLET(ipcrm, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
164USE_IPCS(APPLET(ipcs, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
165USE_IPLINK(APPLET(iplink, _BB_DIR_BIN, _BB_SUID_NEVER))
166USE_IPROUTE(APPLET(iproute, _BB_DIR_BIN, _BB_SUID_NEVER))
167USE_IPRULE(APPLET(iprule, _BB_DIR_BIN, _BB_SUID_NEVER))
168USE_IPTUNNEL(APPLET(iptunnel, _BB_DIR_BIN, _BB_SUID_NEVER))
169USE_KILL(APPLET(kill, _BB_DIR_BIN, _BB_SUID_NEVER))
170USE_KILLALL(APPLET_ODDNAME(killall, kill, _BB_DIR_USR_BIN, _BB_SUID_NEVER, killall))
171USE_KILLALL5(APPLET_ODDNAME(killall5, kill, _BB_DIR_USR_BIN, _BB_SUID_NEVER, killall5))
172USE_KLOGD(APPLET(klogd, _BB_DIR_SBIN, _BB_SUID_NEVER))
173USE_LASH(APPLET(lash, _BB_DIR_BIN, _BB_SUID_NEVER))
174USE_LAST(APPLET(last, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
175USE_LENGTH(APPLET(length, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
176USE_LESS(APPLET(less, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
177USE_SETARCH(APPLET_NOUSAGE(linux32, setarch, _BB_DIR_BIN, _BB_SUID_NEVER))
178USE_SETARCH(APPLET_NOUSAGE(linux64, setarch, _BB_DIR_BIN, _BB_SUID_NEVER))
179USE_FEATURE_INITRD(APPLET_NOUSAGE(linuxrc, init, _BB_DIR_ROOT, _BB_SUID_NEVER))
180USE_LN(APPLET(ln, _BB_DIR_BIN, _BB_SUID_NEVER))
181USE_LOADFONT(APPLET(loadfont, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
182USE_LOADKMAP(APPLET(loadkmap, _BB_DIR_SBIN, _BB_SUID_NEVER))
183USE_LOGGER(APPLET(logger, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
184USE_LOGIN(APPLET(login, _BB_DIR_BIN, _BB_SUID_ALWAYS))
185USE_LOGNAME(APPLET(logname, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
186USE_LOGREAD(APPLET(logread, _BB_DIR_SBIN, _BB_SUID_NEVER))
187USE_LOSETUP(APPLET(losetup, _BB_DIR_SBIN, _BB_SUID_NEVER))
188USE_LS(APPLET(ls, _BB_DIR_BIN, _BB_SUID_NEVER))
189USE_LSATTR(APPLET(lsattr, _BB_DIR_BIN, _BB_SUID_NEVER))
190USE_LSMOD(APPLET(lsmod, _BB_DIR_SBIN, _BB_SUID_NEVER))
191USE_UNLZMA(APPLET_ODDNAME(lzmacat, unlzma, _BB_DIR_USR_BIN, _BB_SUID_NEVER, lzmacat))
192USE_MAKEDEVS(APPLET(makedevs, _BB_DIR_SBIN, _BB_SUID_NEVER))
193USE_MD5SUM(APPLET_ODDNAME(md5sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_NEVER, md5sum))
194USE_MDEV(APPLET(mdev, _BB_DIR_SBIN, _BB_SUID_NEVER))
195USE_MESG(APPLET(mesg, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
196USE_MKDIR(APPLET(mkdir, _BB_DIR_BIN, _BB_SUID_NEVER))
197USE_MKE2FS(APPLET(mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
198USE_MKFIFO(APPLET(mkfifo, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
199USE_MKE2FS(APPLET_NOUSAGE(mkfs.ext2, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
200USE_MKE2FS(APPLET_NOUSAGE(mkfs.ext3, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
201USE_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_minix))
202USE_MKNOD(APPLET(mknod, _BB_DIR_BIN, _BB_SUID_NEVER))
203USE_MKSWAP(APPLET(mkswap, _BB_DIR_SBIN, _BB_SUID_NEVER))
204USE_MKTEMP(APPLET(mktemp, _BB_DIR_BIN, _BB_SUID_NEVER))
205USE_MODPROBE(APPLET(modprobe, _BB_DIR_SBIN, _BB_SUID_NEVER))
206USE_MORE(APPLET(more, _BB_DIR_BIN, _BB_SUID_NEVER))
207USE_MOUNT(APPLET(mount, _BB_DIR_BIN, USE_DESKTOP(_BB_SUID_MAYBE) SKIP_DESKTOP(_BB_SUID_NEVER)))
208USE_MOUNTPOINT(APPLET(mountpoint, _BB_DIR_BIN, _BB_SUID_NEVER))
209USE_MSH(APPLET_NOUSAGE(msh, msh, _BB_DIR_BIN, _BB_SUID_NEVER))
210USE_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_NEVER))
211USE_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_NEVER))
212USE_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_NEVER))
213USE_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
214USE_NETSTAT(APPLET(netstat, _BB_DIR_BIN, _BB_SUID_NEVER))
215USE_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_NEVER))
216USE_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
217USE_NOHUP(APPLET(nohup, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
218USE_NSLOOKUP(APPLET(nslookup, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
219USE_OD(APPLET(od, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
220USE_OPENVT(APPLET(openvt, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
221USE_PASSWD(APPLET(passwd, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
222USE_PATCH(APPLET(patch, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
223USE_PIDOF(APPLET(pidof, _BB_DIR_BIN, _BB_SUID_NEVER))
224USE_PING(APPLET(ping, _BB_DIR_BIN, _BB_SUID_MAYBE))
225USE_PING6(APPLET(ping6, _BB_DIR_BIN, _BB_SUID_NEVER))
226USE_PIPE_PROGRESS(APPLET_NOUSAGE(pipe_progress, pipe_progress, _BB_DIR_BIN, _BB_SUID_NEVER))
227USE_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_NEVER))
228USE_HALT(APPLET_ODDNAME(poweroff, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, poweroff))
229USE_PRINTENV(APPLET(printenv, _BB_DIR_BIN, _BB_SUID_NEVER))
230USE_PRINTF(APPLET(printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
231USE_PS(APPLET(ps, _BB_DIR_BIN, _BB_SUID_NEVER))
232USE_PWD(APPLET(pwd, _BB_DIR_BIN, _BB_SUID_NEVER))
233USE_RAIDAUTORUN(APPLET(raidautorun, _BB_DIR_SBIN, _BB_SUID_NEVER))
234USE_RDATE(APPLET(rdate, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
235USE_READAHEAD(APPLET(readahead, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
236USE_READLINK(APPLET(readlink, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
237USE_READPROFILE(APPLET(readprofile, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
238USE_REALPATH(APPLET(realpath, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
239USE_HALT(APPLET_ODDNAME(reboot, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, reboot))
240USE_RENICE(APPLET(renice, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
241USE_RESET(APPLET(reset, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
242USE_RESIZE(APPLET(resize, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
243USE_RM(APPLET(rm, _BB_DIR_BIN, _BB_SUID_NEVER))
244USE_RMDIR(APPLET(rmdir, _BB_DIR_BIN, _BB_SUID_NEVER))
245USE_RMMOD(APPLET(rmmod, _BB_DIR_SBIN, _BB_SUID_NEVER))
246USE_ROUTE(APPLET(route, _BB_DIR_SBIN, _BB_SUID_NEVER))
247USE_RPM(APPLET(rpm, _BB_DIR_BIN, _BB_SUID_NEVER))
248USE_RPM2CPIO(APPLET(rpm2cpio, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
249USE_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, _BB_DIR_BIN, _BB_SUID_NEVER, run_parts))
250USE_RUNLEVEL(APPLET(runlevel, _BB_DIR_SBIN, _BB_SUID_NEVER))
251USE_RUNSV(APPLET(runsv, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
252USE_RUNSVDIR(APPLET(runsvdir, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
253USE_RX(APPLET(rx, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
254USE_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_NEVER))
255USE_SEQ(APPLET(seq, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
256USE_SETARCH(APPLET(setarch, _BB_DIR_BIN, _BB_SUID_NEVER))
257USE_SETCONSOLE(APPLET(setconsole, _BB_DIR_SBIN, _BB_SUID_NEVER))
258USE_SETKEYCODES(APPLET(setkeycodes, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
259USE_SETLOGCONS(APPLET(setlogcons, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
260USE_SETSID(APPLET(setsid, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
261USE_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, setuidgid))
262USE_FEATURE_SH_IS_ASH(APPLET_NOUSAGE(sh, ash, _BB_DIR_BIN, _BB_SUID_NEVER))
263USE_FEATURE_SH_IS_HUSH(APPLET_NOUSAGE(sh, hush, _BB_DIR_BIN, _BB_SUID_NEVER))
264USE_FEATURE_SH_IS_LASH(APPLET_NOUSAGE(sh, lash, _BB_DIR_BIN, _BB_SUID_NEVER))
265USE_FEATURE_SH_IS_MSH(APPLET_NOUSAGE(sh, msh, _BB_DIR_BIN, _BB_SUID_NEVER))
266USE_SHA1SUM(APPLET_ODDNAME(sha1sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_NEVER, sha1sum))
267USE_SLEEP(APPLET(sleep, _BB_DIR_BIN, _BB_SUID_NEVER))
268USE_SOFTLIMIT(APPLET_ODDNAME(softlimit, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, softlimit))
269USE_SORT(APPLET(sort, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
270USE_START_STOP_DAEMON(APPLET_ODDNAME(start-stop-daemon, start_stop_daemon, _BB_DIR_SBIN, _BB_SUID_NEVER, start_stop_daemon))
271USE_STAT(APPLET(stat, _BB_DIR_BIN, _BB_SUID_NEVER))
272USE_STRINGS(APPLET(strings, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
273USE_STTY(APPLET(stty, _BB_DIR_BIN, _BB_SUID_NEVER))
274USE_SU(APPLET(su, _BB_DIR_BIN, _BB_SUID_ALWAYS))
275USE_SULOGIN(APPLET(sulogin, _BB_DIR_SBIN, _BB_SUID_NEVER))
276USE_SUM(APPLET(sum, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
277USE_SV(APPLET(sv, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
278USE_SVLOGD(APPLET(svlogd, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
279USE_SWAPONOFF(APPLET_ODDNAME(swapoff, swap_on_off, _BB_DIR_SBIN, _BB_SUID_NEVER,swapoff))
280USE_SWAPONOFF(APPLET_ODDNAME(swapon, swap_on_off, _BB_DIR_SBIN, _BB_SUID_NEVER, swapon))
281USE_SWITCH_ROOT(APPLET(switch_root, _BB_DIR_SBIN, _BB_SUID_NEVER))
282USE_SYNC(APPLET(sync, _BB_DIR_BIN, _BB_SUID_NEVER))
283USE_BB_SYSCTL(APPLET(sysctl, _BB_DIR_SBIN, _BB_SUID_NEVER))
284USE_SYSLOGD(APPLET(syslogd, _BB_DIR_SBIN, _BB_SUID_NEVER))
285USE_TAIL(APPLET(tail, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
286USE_TAR(APPLET(tar, _BB_DIR_BIN, _BB_SUID_NEVER))
287USE_TASKSET(APPLET(taskset, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
288USE_TEE(APPLET(tee, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
289USE_TELNET(APPLET(telnet, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
290USE_TELNETD(APPLET(telnetd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
291USE_TEST(APPLET(test, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
292USE_TFTP(APPLET(tftp, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
293USE_TIME(APPLET(time, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
294USE_TOP(APPLET(top, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
295USE_TOUCH(APPLET(touch, _BB_DIR_BIN, _BB_SUID_NEVER))
296USE_TR(APPLET(tr, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
297USE_TRACEROUTE(APPLET(traceroute, _BB_DIR_USR_BIN, _BB_SUID_MAYBE))
298USE_TRUE(APPLET(true, _BB_DIR_BIN, _BB_SUID_NEVER))
299USE_TTY(APPLET(tty, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
300USE_TUNE2FS(APPLET(tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER))
301USE_APP_UDHCPC(APPLET(udhcpc, _BB_DIR_SBIN, _BB_SUID_NEVER))
302USE_APP_UDHCPD(APPLET(udhcpd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
303USE_UMOUNT(APPLET(umount, _BB_DIR_BIN, _BB_SUID_NEVER))
304USE_UNAME(APPLET(uname, _BB_DIR_BIN, _BB_SUID_NEVER))
305USE_UNCOMPRESS(APPLET(uncompress, _BB_DIR_BIN, _BB_SUID_NEVER))
306USE_UNIQ(APPLET(uniq, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
307USE_UNIX2DOS(APPLET_ODDNAME(unix2dos, dos2unix, _BB_DIR_USR_BIN, _BB_SUID_NEVER, unix2dos))
308USE_UNLZMA(APPLET(unlzma, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
309USE_UNZIP(APPLET(unzip, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
310USE_UPTIME(APPLET(uptime, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
311USE_USLEEP(APPLET(usleep, _BB_DIR_BIN, _BB_SUID_NEVER))
312USE_UUDECODE(APPLET(uudecode, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
313USE_UUENCODE(APPLET(uuencode, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
314USE_VCONFIG(APPLET(vconfig, _BB_DIR_SBIN, _BB_SUID_NEVER))
315USE_VI(APPLET(vi, _BB_DIR_BIN, _BB_SUID_NEVER))
316USE_VLOCK(APPLET(vlock, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
317USE_WATCH(APPLET(watch, _BB_DIR_BIN, _BB_SUID_NEVER))
318USE_WATCHDOG(APPLET(watchdog, _BB_DIR_SBIN, _BB_SUID_NEVER))
319USE_WC(APPLET(wc, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
320USE_WGET(APPLET(wget, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
321USE_WHICH(APPLET(which, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
322USE_WHO(APPLET(who, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
323USE_WHOAMI(APPLET(whoami, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
324USE_XARGS(APPLET(xargs, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
325USE_YES(APPLET(yes, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
326USE_GUNZIP(APPLET_ODDNAME(zcat, gunzip, _BB_DIR_BIN, _BB_SUID_NEVER, zcat))
327USE_ZCIP(APPLET(zcip, _BB_DIR_SBIN, _BB_SUID_NEVER))
328
329#if !defined(PROTOTYPES) && !defined(MAKE_USAGE)
330 { 0,NULL,0,0 }
331};
332
333#endif
diff --git a/include/busybox.h b/include/busybox.h
new file mode 100644
index 000000000..d20337ff1
--- /dev/null
+++ b/include/busybox.h
@@ -0,0 +1,47 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * Busybox main internal header file
4 *
5 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 */
7#ifndef _BB_INTERNAL_H_
8#define _BB_INTERNAL_H_ 1
9
10#include "libbb.h"
11
12/* order matters: used as index into "install_dir[]" in busybox.c */
13enum Location {
14 _BB_DIR_ROOT = 0,
15 _BB_DIR_BIN,
16 _BB_DIR_SBIN,
17 _BB_DIR_USR_BIN,
18 _BB_DIR_USR_SBIN
19};
20
21enum SUIDRoot {
22 _BB_SUID_NEVER = 0,
23 _BB_SUID_MAYBE,
24 _BB_SUID_ALWAYS
25};
26
27struct BB_applet {
28 const char *name;
29 int (*main) (int argc, char **argv);
30 __extension__ enum Location location:4;
31 __extension__ enum SUIDRoot need_suid:4;
32};
33
34/* From busybox.c */
35extern const struct BB_applet applets[];
36
37/* Automagically pull in all the applet function prototypes and
38 * applet usage strings. These are all of the form:
39 * extern int foo_main(int argc, char **argv);
40 * extern const char foo_usage[];
41 * These are all autogenerated from the set of currently defined applets.
42 */
43#define PROTOTYPES
44#include "applets.h"
45#undef PROTOTYPES
46
47#endif /* _BB_INTERNAL_H_ */
diff --git a/include/dump.h b/include/dump.h
new file mode 100644
index 000000000..7e1715430
--- /dev/null
+++ b/include/dump.h
@@ -0,0 +1,50 @@
1/* vi: set sw=4 ts=4: */
2#define F_IGNORE 0x01 /* %_A */
3#define F_SETREP 0x02 /* rep count set, not default */
4#define F_ADDRESS 0x001 /* print offset */
5#define F_BPAD 0x002 /* blank pad */
6#define F_C 0x004 /* %_c */
7#define F_CHAR 0x008 /* %c */
8#define F_DBL 0x010 /* %[EefGf] */
9#define F_INT 0x020 /* %[di] */
10#define F_P 0x040 /* %_p */
11#define F_STR 0x080 /* %s */
12#define F_U 0x100 /* %_u */
13#define F_UINT 0x200 /* %[ouXx] */
14#define F_TEXT 0x400 /* no conversions */
15
16enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */
17
18typedef struct _pr {
19 struct _pr *nextpr; /* next print unit */
20 unsigned int flags; /* flag values */
21 int bcnt; /* byte count */
22 char *cchar; /* conversion character */
23 char *fmt; /* printf format */
24 char *nospace; /* no whitespace version */
25} PR;
26
27typedef struct _fu {
28 struct _fu *nextfu; /* next format unit */
29 struct _pr *nextpr; /* next print unit */
30 unsigned int flags; /* flag values */
31 int reps; /* repetition count */
32 int bcnt; /* byte count */
33 char *fmt; /* format string */
34} FU;
35
36typedef struct _fs { /* format strings */
37 struct _fs *nextfs; /* linked list of format strings */
38 struct _fu *nextfu; /* linked list of format units */
39 int bcnt;
40} FS;
41
42extern void bb_dump_add(const char *fmt);
43extern int bb_dump_dump(char **argv);
44extern int bb_dump_size(FS * fs);
45
46extern FS *bb_dump_fshead; /* head of format strings */
47extern int bb_dump_blocksize; /* data block size */
48extern int bb_dump_length; /* max bytes to read */
49extern enum _vflag bb_dump_vflag;
50extern off_t bb_dump_skip; /* bytes to skip */
diff --git a/include/grp_.h b/include/grp_.h
new file mode 100644
index 000000000..b34addfa2
--- /dev/null
+++ b/include/grp_.h
@@ -0,0 +1,115 @@
1/* vi: set sw=4 ts=4: */
2/* Copyright (C) 1991,92,95,96,97,98,99,2000,01 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
19
20/*
21 * POSIX Standard: 9.2.1 Group Database Access <grp.h>
22 */
23
24
25#if !defined CONFIG_USE_BB_PWD_GRP
26#include <grp.h>
27
28#else
29
30#ifndef _GRP_H
31#define _GRP_H 1
32
33#include <sys/types.h>
34#include <features.h>
35#include <stdio.h>
36
37/* The group structure. */
38struct group
39{
40 char *gr_name; /* Group name. */
41 char *gr_passwd; /* Password. */
42 gid_t gr_gid; /* Group ID. */
43 char **gr_mem; /* Member list. */
44};
45
46
47/* Rewind the group-file stream. */
48extern void setgrent (void);
49
50/* Close the group-file stream. */
51extern void endgrent (void);
52
53/* Read an entry from the group-file stream, opening it if necessary. */
54extern struct group *getgrent (void);
55
56/* Read a group entry from STREAM. */
57extern struct group *fgetgrent (FILE *__stream);
58
59/* Write the given entry onto the given stream. */
60extern int putgrent (__const struct group *__restrict __p,
61 FILE *__restrict __f);
62
63/* Search for an entry with a matching group ID. */
64extern struct group *getgrgid (gid_t __gid);
65
66/* Search for an entry with a matching group name. */
67extern struct group *getgrnam (__const char *__name);
68
69/* Reentrant versions of some of the functions above.
70
71 PLEASE NOTE: the `getgrent_r' function is not (yet) standardized.
72 The interface may change in later versions of this library. But
73 the interface is designed following the principals used for the
74 other reentrant functions so the chances are good this is what the
75 POSIX people would choose. */
76
77extern int getgrent_r (struct group *__restrict __resultbuf,
78 char *__restrict __buffer, size_t __buflen,
79 struct group **__restrict __result);
80
81/* Search for an entry with a matching group ID. */
82extern int getgrgid_r (gid_t __gid, struct group *__restrict __resultbuf,
83 char *__restrict __buffer, size_t __buflen,
84 struct group **__restrict __result);
85
86/* Search for an entry with a matching group name. */
87extern int getgrnam_r (__const char *__restrict __name,
88 struct group *__restrict __resultbuf,
89 char *__restrict __buffer, size_t __buflen,
90 struct group **__restrict __result);
91
92/* Read a group entry from STREAM. This function is not standardized
93 an probably never will. */
94extern int fgetgrent_r (FILE *__restrict __stream,
95 struct group *__restrict __resultbuf,
96 char *__restrict __buffer, size_t __buflen,
97 struct group **__restrict __result);
98
99/* Set the group set for the current user to GROUPS (N of them). */
100extern int setgroups (size_t __n, __const gid_t *__groups);
101
102/* Store at most *NGROUPS members of the group set for USER into
103 *GROUPS. Also include GROUP. The actual number of groups found is
104 returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */
105extern int getgrouplist (__const char *__user, gid_t __group,
106 gid_t *__groups, int *__ngroups);
107
108/* Initialize the group set for the current user
109 by reading the group database and using all groups
110 of which USER is a member. Also include GROUP. */
111extern int initgroups (__const char *__user, gid_t __group);
112
113
114#endif /* grp.h */
115#endif
diff --git a/include/inet_common.h b/include/inet_common.h
new file mode 100644
index 000000000..1c16f6ca2
--- /dev/null
+++ b/include/inet_common.h
@@ -0,0 +1,30 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * stolen from net-tools-1.59 and stripped down for busybox by
4 * Erik Andersen <andersen@codepoet.org>
5 *
6 * Heavily modified by Manuel Novoa III Mar 12, 2001
7 *
8 * Version: $Id: inet_common.h,v 1.4 2004/03/10 07:42:37 mjn3 Exp $
9 *
10 */
11
12#include <features.h>
13#include <sys/types.h>
14#include <sys/socket.h>
15#include "platform.h"
16
17/* hostfirst!=0 If we expect this to be a hostname,
18 try hostname database first
19 */
20extern int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst);
21
22/* numeric: & 0x8000: "default" instead of "*",
23 * & 0x4000: host instead of net,
24 * & 0x0fff: don't resolve
25 */
26extern int INET_rresolve(char *name, size_t len, struct sockaddr_in *s_in,
27 int numeric, unsigned int netmask);
28
29extern int INET6_resolve(const char *name, struct sockaddr_in6 *sin6);
30extern int INET6_rresolve(char *name, size_t len, struct sockaddr_in6 *sin6, int numeric);
diff --git a/include/libbb.h b/include/libbb.h
new file mode 100644
index 000000000..1d91a0a72
--- /dev/null
+++ b/include/libbb.h
@@ -0,0 +1,689 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * Busybox main internal header file
4 *
5 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
6 * Permission has been granted to redistribute this code under the GPL.
7 *
8 * Licensed under the GPL version 2, see the file LICENSE in this tarball.
9 */
10#ifndef __LIBBUSYBOX_H__
11#define __LIBBUSYBOX_H__ 1
12
13#include "platform.h"
14
15#include <ctype.h>
16#include <dirent.h>
17#include <errno.h>
18#include <fcntl.h>
19#include <inttypes.h>
20#include <malloc.h>
21#include <netdb.h>
22#include <setjmp.h>
23#include <signal.h>
24#include <stdio.h>
25#include <stdlib.h>
26#include <stdarg.h>
27#include <string.h>
28#include <strings.h>
29#include <sys/ioctl.h>
30#include <sys/mman.h>
31#include <sys/socket.h>
32#include <sys/stat.h>
33#include <sys/statfs.h>
34#include <sys/time.h>
35#include <sys/types.h>
36#include <sys/wait.h>
37#include <termios.h>
38#include <time.h>
39#include <unistd.h>
40#include <utime.h>
41
42#ifdef CONFIG_SELINUX
43#include <selinux/selinux.h>
44#endif
45
46#ifdef CONFIG_LOCALE_SUPPORT
47#include <locale.h>
48#else
49#define setlocale(x,y)
50#endif
51
52#include "pwd_.h"
53#include "grp_.h"
54#include "shadow_.h"
55
56/* Try to pull in PATH_MAX */
57#include <limits.h>
58#include <sys/param.h>
59#ifndef PATH_MAX
60#define PATH_MAX 256
61#endif
62
63/* Tested to work correctly (IIRC :]) */
64#define MAXINT(T) (T)( \
65 ((T)-1) > 0 \
66 ? (T)-1 \
67 : (T)~((T)1 << (sizeof(T)*8-1)) \
68 )
69
70#define MININT(T) (T)( \
71 ((T)-1) > 0 \
72 ? (T)0 \
73 : ((T)1 << (sizeof(T)*8-1)) \
74 )
75
76/* Large file support */
77/* Note that CONFIG_LFS forces bbox to be built with all common ops
78 * (stat, lseek etc) mapped to "largefile" variants by libc.
79 * Practically it means that open() automatically has O_LARGEFILE added
80 * and all filesize/file_offset parameters and struct members are "large"
81 * (in today's world - signed 64bit). For full support of large files,
82 * we need a few helper #defines (below) and careful use of off_t
83 * instead of int/ssize_t. No lseek64(), O_LARGEFILE etc necessary */
84#if ENABLE_LFS
85/* CONFIG_LFS is on */
86# if ULONG_MAX > 0xffffffff
87/* "long" is long enough on this system */
88# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX)
89/* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */
90# define BB_STRTOOFF bb_strtoul
91# define STRTOOFF strtoul
92/* usage: printf("size: %"OFF_FMT"d (%"OFF_FMT"x)\n", sz, sz); */
93# define OFF_FMT "l"
94# else
95/* "long" is too short, need "long long" */
96# define XATOOFF(a) xatoull_range(a, 0, LLONG_MAX)
97# define BB_STRTOOFF bb_strtoull
98# define STRTOOFF strtoull
99# define OFF_FMT "ll"
100# endif
101#else
102/* CONFIG_LFS is off */
103# if UINT_MAX == 0xffffffff
104/* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway.
105 * gcc will throw warnings on printf("%d", off_t). Crap... */
106# define XATOOFF(a) xatoi_u(a)
107# define BB_STRTOOFF bb_strtou
108# define STRTOOFF strtol
109# define OFF_FMT "l"
110# else
111# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX)
112# define BB_STRTOOFF bb_strtoul
113# define STRTOOFF strtol
114# define OFF_FMT "l"
115# endif
116#endif
117/* scary. better ideas? (but do *test* them first!) */
118#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1)))
119
120/* Some useful definitions */
121#undef FALSE
122#define FALSE ((int) 0)
123#undef TRUE
124#define TRUE ((int) 1)
125#undef SKIP
126#define SKIP ((int) 2)
127
128/* for mtab.c */
129#define MTAB_GETMOUNTPT '1'
130#define MTAB_GETDEVICE '2'
131
132#define BUF_SIZE 8192
133#define EXPAND_ALLOC 1024
134
135/* Macros for min/max. */
136#ifndef MIN
137#define MIN(a,b) (((a)<(b))?(a):(b))
138#endif
139
140#ifndef MAX
141#define MAX(a,b) (((a)>(b))?(a):(b))
142#endif
143
144/* buffer allocation schemes */
145#ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
146#define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]
147#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
148#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
149#else
150#ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
151#define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len]
152#define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
153#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
154#else
155#define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len)
156#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
157#define RELEASE_CONFIG_BUFFER(buffer) free (buffer)
158#endif
159#endif
160
161
162#if (__GLIBC__ < 2)
163int vdprintf(int d, const char *format, va_list ap);
164#endif
165// This is declared here rather than #including <libgen.h> in order to avoid
166// confusing the two versions of basename. See the dirname/basename man page
167// for details.
168char *dirname(char *path);
169/* Include our own copy of struct sysinfo to avoid binary compatibility
170 * problems with Linux 2.4, which changed things. Grumble, grumble. */
171struct sysinfo {
172 long uptime; /* Seconds since boot */
173 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
174 unsigned long totalram; /* Total usable main memory size */
175 unsigned long freeram; /* Available memory size */
176 unsigned long sharedram; /* Amount of shared memory */
177 unsigned long bufferram; /* Memory used by buffers */
178 unsigned long totalswap; /* Total swap space size */
179 unsigned long freeswap; /* swap space still available */
180 unsigned short procs; /* Number of current processes */
181 unsigned short pad; /* Padding needed for m68k */
182 unsigned long totalhigh; /* Total high memory size */
183 unsigned long freehigh; /* Available high memory size */
184 unsigned int mem_unit; /* Memory unit size in bytes */
185 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
186};
187extern int sysinfo(struct sysinfo* info);
188
189
190extern void chomp(char *s);
191extern void trim(char *s);
192extern char *skip_whitespace(const char *);
193
194extern const char *bb_mode_string(int mode);
195extern int is_directory(const char *name, int followLinks, struct stat *statBuf);
196extern int remove_file(const char *path, int flags);
197extern int copy_file(const char *source, const char *dest, int flags);
198extern int recursive_action(const char *fileName, int recurse,
199 int followLinks, int depthFirst,
200 int (*fileAction) (const char *fileName, struct stat* statbuf, void* userData, int depth),
201 int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth),
202 void* userData, int depth);
203extern int device_open(const char *device, int mode);
204extern int get_console_fd(void);
205extern char *find_block_device(char *path);
206extern off_t bb_copyfd_size(int fd1, int fd2, off_t size);
207extern off_t bb_copyfd_eof(int fd1, int fd2);
208extern char bb_process_escape_sequence(const char **ptr);
209extern char *bb_get_last_path_component(char *path);
210extern int ndelay_on(int fd);
211
212
213extern DIR *xopendir(const char *path);
214extern DIR *warn_opendir(const char *path);
215
216char *xgetcwd(char *cwd);
217char *xreadlink(const char *path);
218extern void xstat(char *filename, struct stat *buf);
219extern pid_t spawn(char **argv);
220extern pid_t xspawn(char **argv);
221extern int wait4pid(int pid);
222extern void xsetgid(gid_t gid);
223extern void xsetuid(uid_t uid);
224extern void xdaemon(int nochdir, int noclose);
225extern void xchdir(const char *path);
226extern void xsetenv(const char *key, const char *value);
227extern int xopen(const char *pathname, int flags);
228extern int xopen3(const char *pathname, int flags, int mode);
229extern off_t xlseek(int fd, off_t offset, int whence);
230extern off_t fdlength(int fd);
231
232
233extern int xsocket(int domain, int type, int protocol);
234extern void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen);
235extern void xlisten(int s, int backlog);
236extern void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen);
237extern int xconnect_tcp_v4(struct sockaddr_in *s_addr);
238extern struct hostent *xgethostbyname(const char *name);
239extern struct hostent *xgethostbyname2(const char *name, int af);
240extern int xsocket_stream_ip4or6(sa_family_t *fp);
241typedef union {
242 struct sockaddr sa;
243 struct sockaddr_in sin;
244#if ENABLE_FEATURE_IPV6
245 struct sockaddr_in6 sin6;
246#endif
247} sockaddr_inet;
248extern int dotted2sockaddr(const char *dotted, struct sockaddr* sp, int socklen);
249extern int create_and_bind_socket_ip4or6(const char *hostaddr, int port);
250extern int setsockopt_reuseaddr(int fd);
251extern int setsockopt_broadcast(int fd);
252
253
254extern char *xstrdup(const char *s);
255extern char *xstrndup(const char *s, int n);
256extern char *safe_strncpy(char *dst, const char *src, size_t size);
257extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
258
259/* dmalloc will redefine these to it's own implementation. It is safe
260 * to have the prototypes here unconditionally. */
261extern void *xmalloc(size_t size);
262extern void *xrealloc(void *old, size_t size);
263extern void *xzalloc(size_t size);
264
265extern ssize_t safe_read(int fd, void *buf, size_t count);
266extern ssize_t full_read(int fd, void *buf, size_t count);
267extern void xread(int fd, void *buf, size_t count);
268extern unsigned char xread_char(int fd);
269extern char *reads(int fd, char *buf, size_t count);
270extern ssize_t read_close(int fd, void *buf, size_t count);
271extern ssize_t open_read_close(const char *filename, void *buf, size_t count);
272extern void *xmalloc_open_read_close(const char *filename, size_t *sizep);
273
274extern ssize_t safe_write(int fd, const void *buf, size_t count);
275extern ssize_t full_write(int fd, const void *buf, size_t count);
276extern void xwrite(int fd, const void *buf, size_t count);
277
278/* Reads and prints to stdout till eof, then closes FILE. Exits on error: */
279extern void xprint_and_close_file(FILE *file);
280extern char *xmalloc_fgets(FILE *file);
281/* Read up to (and including) TERMINATING_STRING: */
282extern char *xmalloc_fgets_str(FILE *file, const char *terminating_string);
283/* Chops off '\n' from the end, unlike fgets: */
284extern char *xmalloc_getline(FILE *file);
285extern char *bb_get_chunk_from_file(FILE *file, int *end);
286extern void die_if_ferror(FILE *file, const char *msg);
287extern void die_if_ferror_stdout(void);
288extern void xfflush_stdout(void);
289extern void fflush_stdout_and_exit(int retval) ATTRIBUTE_NORETURN;
290extern int fclose_if_not_stdin(FILE *file);
291extern FILE *xfopen(const char *filename, const char *mode);
292/* Prints warning to stderr and returns NULL on failure: */
293extern FILE *fopen_or_warn(const char *filename, const char *mode);
294/* "Opens" stdin if filename is special, else just opens file: */
295extern FILE *fopen_or_warn_stdin(const char *filename);
296
297
298extern void smart_ulltoa5(unsigned long long ul, char buf[5]);
299extern void utoa_to_buf(unsigned n, char *buf, unsigned buflen);
300extern char *utoa(unsigned n);
301extern void itoa_to_buf(int n, char *buf, unsigned buflen);
302extern char *itoa(int n);
303
304struct suffix_mult {
305 const char *suffix;
306 unsigned mult;
307};
308#include "xatonum.h"
309/* Specialized: */
310/* Using xatoi() instead of naive atoi() is not always convenient -
311 * in many places people want *non-negative* values, but store them
312 * in signed int. Therefore we need this one:
313 * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */
314int xatoi_u(const char *numstr);
315/* Useful for reading port numbers */
316uint16_t xatou16(const char *numstr);
317
318
319/* These parse entries in /etc/passwd and /etc/group. This is desirable
320 * for BusyBox since we want to avoid using the glibc NSS stuff, which
321 * increases target size and is often not needed on embedded systems. */
322extern long bb_xgetpwnam(const char *name);
323extern long bb_xgetgrnam(const char *name);
324/*extern char *bb_getug(char *buffer, char *idname, long id, int bufsize, char prefix);*/
325extern char *bb_getpwuid(char *name, long uid, int bufsize);
326extern char *bb_getgrgid(char *group, long gid, int bufsize);
327/* from chpst */
328struct bb_uidgid_t {
329 uid_t uid;
330 gid_t gid;
331};
332extern unsigned uidgid_get(struct bb_uidgid_t*, const char* /*, unsigned*/);
333
334
335enum { BB_GETOPT_ERROR = 0x80000000 };
336extern const char *opt_complementary;
337#if ENABLE_GETOPT_LONG
338extern const struct option *applet_long_options;
339#endif
340extern uint32_t option_mask32;
341extern uint32_t getopt32(int argc, char **argv, const char *applet_opts, ...);
342
343
344typedef struct llist_s {
345 char *data;
346 struct llist_s *link;
347} llist_t;
348extern void llist_add_to(llist_t **old_head, void *data);
349extern void llist_add_to_end(llist_t **list_head, void *data);
350extern void *llist_pop(llist_t **elm);
351extern void llist_free(llist_t *elm, void (*freeit)(void *data));
352extern llist_t* rev_llist(llist_t *list);
353
354enum {
355 LOGMODE_NONE = 0,
356 LOGMODE_STDIO = 1<<0,
357 LOGMODE_SYSLOG = 1<<1,
358 LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO,
359};
360extern const char *msg_eol;
361extern int logmode;
362extern int die_sleep;
363extern int xfunc_error_retval;
364extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE;
365extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
366extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
367extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
368extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
369extern void bb_vherror_msg(const char *s, va_list p);
370extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
371extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
372extern void bb_perror_nomsg_and_die(void) ATTRIBUTE_NORETURN;
373extern void bb_perror_nomsg(void);
374extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
375/* These are used internally -- you shouldn't need to use them */
376extern void bb_verror_msg(const char *s, va_list p, const char *strerr);
377extern void bb_vperror_msg(const char *s, va_list p);
378extern void bb_vinfo_msg(const char *s, va_list p);
379
380
381extern int bb_echo(int argc, char** argv);
382extern int bb_test(int argc, char** argv);
383
384#ifndef BUILD_INDIVIDUAL
385extern struct BB_applet *find_applet_by_name(const char *name);
386extern void run_applet_by_name(const char *name, int argc, char **argv);
387#endif
388
389extern struct mntent *find_mount_point(const char *name, const char *table);
390extern void erase_mtab(const char * name);
391extern unsigned int tty_baud_to_value(speed_t speed);
392extern speed_t tty_value_to_baud(unsigned int value);
393extern void bb_warn_ignoring_args(int n);
394
395extern int get_linux_version_code(void);
396
397extern char *query_loop(const char *device);
398extern int del_loop(const char *device);
399extern int set_loop(char **device, const char *file, unsigned long long offset);
400
401
402const char *make_human_readable_str(unsigned long long size,
403 unsigned long block_size, unsigned long display_unit);
404
405char *bb_askpass(int timeout, const char * prompt);
406int bb_ask_confirmation(void);
407int klogctl(int type, char * b, int len);
408
409extern int bb_parse_mode(const char* s, mode_t* theMode);
410
411char *concat_path_file(const char *path, const char *filename);
412char *concat_subpath_file(const char *path, const char *filename);
413char *last_char_is(const char *s, int c);
414
415int execable_file(const char *name);
416char *find_execable(const char *filename);
417int exists_execable(const char *filename);
418
419USE_DESKTOP(long long) int uncompress(int fd_in, int fd_out);
420int inflate(int in, int out);
421
422int create_icmp_socket(void);
423int create_icmp6_socket(void);
424
425unsigned short bb_lookup_port(const char *port, const char *protocol, unsigned short default_port);
426void bb_lookup_host(struct sockaddr_in *s_in, const char *host);
427
428int bb_make_directory(char *path, long mode, int flags);
429
430int get_signum(const char *name);
431const char *get_signame(int number);
432
433char *bb_simplify_path(const char *path);
434
435#define FAIL_DELAY 3
436extern void bb_do_delay(int seconds);
437extern void change_identity(const struct passwd *pw);
438extern const char *change_identity_e2str(const struct passwd *pw);
439extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args);
440#ifdef CONFIG_SELINUX
441extern void renew_current_security_context(void);
442extern void set_current_security_context(security_context_t sid);
443#endif
444extern int restricted_shell(const char *shell);
445extern void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw);
446extern int correct_password(const struct passwd *pw);
447extern char *pw_encrypt(const char *clear, const char *salt);
448extern int obscure(const char *old, const char *newval, const struct passwd *pwdp);
449extern int index_in_str_array(const char * const string_array[], const char *key);
450extern int index_in_substr_array(const char * const string_array[], const char *key);
451extern void print_login_issue(const char *issue_file, const char *tty);
452extern void print_login_prompt(void);
453#ifdef BB_NOMMU
454extern void vfork_daemon(int nochdir, int noclose);
455extern void vfork_daemon_rexec(int nochdir, int noclose,
456 int argc, char **argv, char *foreground_opt);
457#endif
458extern int get_terminal_width_height(int fd, int *width, int *height);
459extern unsigned long get_ug_id(const char *s, long (*__bb_getxxnam)(const char *));
460
461int is_in_ino_dev_hashtable(const struct stat *statbuf, char **name);
462void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name);
463void reset_ino_dev_hashtable(void);
464#ifdef __GLIBC__
465/* At least glibc has horrendously large inline for this, so wrap it */
466extern unsigned long long bb_makedev(unsigned int major, unsigned int minor);
467#undef makedev
468#define makedev(a,b) bb_makedev(a,b)
469#endif
470
471
472#ifndef COMM_LEN
473#ifdef TASK_COMM_LEN
474enum { COMM_LEN = TASK_COMM_LEN };
475#else
476/* synchronize with sizeof(task_struct.comm) in /usr/include/linux/sched.h */
477enum { COMM_LEN = 16 };
478#endif
479#endif
480typedef struct {
481 DIR *dir;
482/* Fields are set to 0/NULL if failed to determine (or not requested) */
483 char *cmd;
484 unsigned long rss;
485 unsigned long stime, utime;
486 unsigned pid;
487 unsigned ppid;
488 unsigned pgid;
489 unsigned sid;
490 unsigned uid;
491 unsigned gid;
492 /* basename of executable file in call to exec(2), size from */
493 /* sizeof(task_struct.comm) in /usr/include/linux/sched.h */
494 char state[4];
495 char comm[COMM_LEN];
496// user/group? - use passwd/group parsing functions
497} procps_status_t;
498enum {
499 PSSCAN_PID = 1 << 0,
500 PSSCAN_PPID = 1 << 1,
501 PSSCAN_PGID = 1 << 2,
502 PSSCAN_SID = 1 << 3,
503 PSSCAN_UIDGID = 1 << 4,
504 PSSCAN_COMM = 1 << 5,
505 PSSCAN_CMD = 1 << 6,
506 PSSCAN_STATE = 1 << 7,
507 PSSCAN_RSS = 1 << 8,
508 PSSCAN_STIME = 1 << 9,
509 PSSCAN_UTIME = 1 << 10,
510 /* These are all retrieved from proc/NN/stat in one go: */
511 PSSCAN_STAT = PSSCAN_PPID | PSSCAN_PGID | PSSCAN_SID
512 | PSSCAN_COMM | PSSCAN_STATE
513 | PSSCAN_RSS | PSSCAN_STIME | PSSCAN_UTIME,
514};
515procps_status_t* alloc_procps_scan(int flags);
516void free_procps_scan(procps_status_t* sp);
517procps_status_t* procps_scan(procps_status_t* sp, int flags);
518pid_t *find_pid_by_name(const char* procName);
519pid_t *pidlist_reverse(pid_t *pidList);
520void clear_username_cache(void);
521const char* get_cached_username(uid_t uid);
522const char* get_cached_groupname(gid_t gid);
523
524
525extern const char bb_uuenc_tbl_base64[];
526extern const char bb_uuenc_tbl_std[];
527void bb_uuencode(const unsigned char *s, char *store, const int length, const char *tbl);
528
529typedef struct sha1_ctx_t {
530 uint32_t count[2];
531 uint32_t hash[5];
532 uint32_t wbuf[16];
533} sha1_ctx_t;
534void sha1_begin(sha1_ctx_t *ctx);
535void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx);
536void *sha1_end(void *resbuf, sha1_ctx_t *ctx);
537
538typedef struct md5_ctx_t {
539 uint32_t A;
540 uint32_t B;
541 uint32_t C;
542 uint32_t D;
543 uint64_t total;
544 uint32_t buflen;
545 char buffer[128];
546} md5_ctx_t;
547void md5_begin(md5_ctx_t *ctx);
548void md5_hash(const void *data, size_t length, md5_ctx_t *ctx);
549void *md5_end(void *resbuf, md5_ctx_t *ctx);
550
551uint32_t *crc32_filltable(int endian);
552
553
554enum { /* DO NOT CHANGE THESE VALUES! cp.c depends on them. */
555 FILEUTILS_PRESERVE_STATUS = 1,
556 FILEUTILS_DEREFERENCE = 2,
557 FILEUTILS_RECUR = 4,
558 FILEUTILS_FORCE = 8,
559 FILEUTILS_INTERACTIVE = 0x10,
560 FILEUTILS_MAKE_HARDLINK = 0x20,
561 FILEUTILS_MAKE_SOFTLINK = 0x40,
562};
563#define FILEUTILS_CP_OPTSTR "pdRfils"
564
565extern const char *applet_name;
566extern const char BB_BANNER[];
567
568extern const char bb_msg_full_version[];
569extern const char bb_msg_memory_exhausted[];
570extern const char bb_msg_invalid_date[];
571extern const char bb_msg_read_error[];
572extern const char bb_msg_write_error[];
573extern const char bb_msg_unknown[];
574extern const char bb_msg_can_not_create_raw_socket[];
575extern const char bb_msg_perm_denied_are_you_root[];
576extern const char bb_msg_requires_arg[];
577extern const char bb_msg_invalid_arg[];
578extern const char bb_msg_standard_input[];
579extern const char bb_msg_standard_output[];
580
581extern const char bb_str_default[];
582
583extern const char bb_path_mtab_file[];
584extern const char bb_path_nologin_file[];
585extern const char bb_path_passwd_file[];
586extern const char bb_path_shadow_file[];
587extern const char bb_path_gshadow_file[];
588extern const char bb_path_group_file[];
589extern const char bb_path_securetty_file[];
590extern const char bb_path_motd_file[];
591extern const char bb_path_wtmp_file[];
592extern const char bb_dev_null[];
593
594#ifndef BUFSIZ
595#define BUFSIZ 4096
596#endif
597extern char bb_common_bufsiz1[BUFSIZ+1];
598
599/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it,
600 * use bb_default_login_shell and following defines.
601 * If you change LIBBB_DEFAULT_LOGIN_SHELL,
602 * don't forget to change increment constant. */
603#define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh"
604extern const char bb_default_login_shell[];
605/* "/bin/sh" */
606#define DEFAULT_SHELL (bb_default_login_shell+1)
607/* "sh" */
608#define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6)
609
610
611#ifdef CONFIG_FEATURE_DEVFS
612# define CURRENT_VC "/dev/vc/0"
613# define VC_1 "/dev/vc/1"
614# define VC_2 "/dev/vc/2"
615# define VC_3 "/dev/vc/3"
616# define VC_4 "/dev/vc/4"
617# define VC_5 "/dev/vc/5"
618#if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__)
619/* Yes, this sucks, but both SH (including sh64) and H8 have a SCI(F) for their
620 respective serial ports .. as such, we can't use the common device paths for
621 these. -- PFM */
622# define SC_0 "/dev/ttsc/0"
623# define SC_1 "/dev/ttsc/1"
624# define SC_FORMAT "/dev/ttsc/%d"
625#else
626# define SC_0 "/dev/tts/0"
627# define SC_1 "/dev/tts/1"
628# define SC_FORMAT "/dev/tts/%d"
629#endif
630# define VC_FORMAT "/dev/vc/%d"
631# define LOOP_FORMAT "/dev/loop/%d"
632# define LOOP_NAME "/dev/loop/"
633# define FB_0 "/dev/fb/0"
634#else
635# define CURRENT_VC "/dev/tty0"
636# define VC_1 "/dev/tty1"
637# define VC_2 "/dev/tty2"
638# define VC_3 "/dev/tty3"
639# define VC_4 "/dev/tty4"
640# define VC_5 "/dev/tty5"
641#if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__)
642# define SC_0 "/dev/ttySC0"
643# define SC_1 "/dev/ttySC1"
644# define SC_FORMAT "/dev/ttySC%d"
645#else
646# define SC_0 "/dev/ttyS0"
647# define SC_1 "/dev/ttyS1"
648# define SC_FORMAT "/dev/ttyS%d"
649#endif
650# define VC_FORMAT "/dev/tty%d"
651# define LOOP_FORMAT "/dev/loop%d"
652# define LOOP_NAME "/dev/loop"
653# define FB_0 "/dev/fb0"
654#endif
655
656/* The following devices are the same on devfs and non-devfs systems. */
657#define CURRENT_TTY "/dev/tty"
658#define CONSOLE_DEV "/dev/console"
659
660
661#ifndef RB_POWER_OFF
662/* Stop system and switch power off if possible. */
663#define RB_POWER_OFF 0x4321fedc
664#endif
665
666/* Make sure we call functions instead of macros. */
667#undef isalnum
668#undef isalpha
669#undef isascii
670#undef isblank
671#undef iscntrl
672#undef isgraph
673#undef islower
674#undef isprint
675#undef ispunct
676#undef isspace
677#undef isupper
678#undef isxdigit
679
680/* This one is more efficient - we save ~400 bytes */
681#undef isdigit
682#define isdigit(a) ((unsigned)((a) - '0') <= 9)
683
684
685#ifdef DMALLOC
686#include <dmalloc.h>
687#endif
688
689#endif /* __LIBBUSYBOX_H__ */
diff --git a/include/platform.h b/include/platform.h
new file mode 100644
index 000000000..345e9cb7a
--- /dev/null
+++ b/include/platform.h
@@ -0,0 +1,276 @@
1/* vi: set sw=4 ts=4: */
2/*
3 Copyright 2006, Bernhard Fischer
4
5 Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6*/
7#ifndef __PLATFORM_H
8#define __PLATFORM_H 1
9
10/* Convenience macros to test the version of gcc. */
11#undef __GNUC_PREREQ
12#if defined __GNUC__ && defined __GNUC_MINOR__
13# define __GNUC_PREREQ(maj, min) \
14 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
15#else
16# define __GNUC_PREREQ(maj, min) 0
17#endif
18
19/* __restrict is known in EGCS 1.2 and above. */
20#if !__GNUC_PREREQ (2,92)
21# ifndef __restrict
22# define __restrict /* Ignore */
23# endif
24#endif
25
26/* Define macros for some gcc attributes. This permits us to use the
27 macros freely, and know that they will come into play for the
28 version of gcc in which they are supported. */
29
30#if !__GNUC_PREREQ (2,7)
31# ifndef __attribute__
32# define __attribute__(x)
33# endif
34#endif
35
36#undef inline
37#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
38/* it's a keyword */
39#else
40# if __GNUC_PREREQ (2,7)
41# define inline __inline__
42# else
43# define inline
44# endif
45#endif
46
47#ifndef __const
48# define __const const
49#endif
50
51# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
52# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
53# define ATTRIBUTE_PACKED __attribute__ ((__packed__))
54# define ATTRIBUTE_ALIGNED(m) __attribute__ ((__aligned__(m)))
55# if __GNUC_PREREQ (3,0)
56# define ATTRIBUTE_ALWAYS_INLINE __attribute__ ((always_inline)) inline
57# else
58# define ATTRIBUTE_ALWAYS_INLINE inline
59# endif
60
61/* -fwhole-program makes all symbols local. The attribute externally_visible
62 forces a symbol global. */
63# if __GNUC_PREREQ (4,1)
64# define ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((__externally_visible__))
65# else
66# define ATTRIBUTE_EXTERNALLY_VISIBLE
67# endif /* GNUC >= 4.1 */
68
69/* We use __extension__ in some places to suppress -pedantic warnings
70 about GCC extensions. This feature didn't work properly before
71 gcc 2.8. */
72#if !__GNUC_PREREQ (2,8)
73# ifndef __extension__
74# define __extension__
75# endif
76#endif
77
78/* gcc-2.95 had no va_copy but only __va_copy. */
79#if !__GNUC_PREREQ (3,0)
80# include <stdarg.h>
81# if !defined va_copy && defined __va_copy
82# define va_copy(d,s) __va_copy((d),(s))
83# endif
84#endif
85
86/* ---- Endian Detection ------------------------------------ */
87
88#if (defined __digital__ && defined __unix__)
89# include <sex.h>
90# define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN)
91# define __BYTE_ORDER BYTE_ORDER
92#elif !defined __APPLE__
93# include <byteswap.h>
94# include <endian.h>
95#endif
96
97#ifdef __BIG_ENDIAN__
98# define BB_BIG_ENDIAN 1
99# define BB_LITTLE_ENDIAN 0
100#elif __BYTE_ORDER == __BIG_ENDIAN
101# define BB_BIG_ENDIAN 1
102# define BB_LITTLE_ENDIAN 0
103#else
104# define BB_BIG_ENDIAN 0
105# define BB_LITTLE_ENDIAN 1
106#endif
107
108#if BB_BIG_ENDIAN
109#define SWAP_BE16(x) (x)
110#define SWAP_BE32(x) (x)
111#define SWAP_BE64(x) (x)
112#define SWAP_LE16(x) bswap_16(x)
113#define SWAP_LE32(x) bswap_32(x)
114#define SWAP_LE64(x) bswap_64(x)
115#else
116#define SWAP_BE16(x) bswap_16(x)
117#define SWAP_BE32(x) bswap_32(x)
118#define SWAP_BE64(x) bswap_64(x)
119#define SWAP_LE16(x) (x)
120#define SWAP_LE32(x) (x)
121#define SWAP_LE64(x) (x)
122#endif
123
124/* ---- Networking ------------------------------------------ */
125#ifndef __APPLE__
126# include <arpa/inet.h>
127#else
128# include <netinet/in.h>
129#endif
130
131#ifndef __socklen_t_defined
132typedef int socklen_t;
133#endif
134
135/* ---- Compiler dependent settings ------------------------- */
136#ifndef __GNUC__
137#if defined __INTEL_COMPILER
138__extension__ typedef __signed__ long long __s64;
139__extension__ typedef unsigned long long __u64;
140#endif /* __INTEL_COMPILER */
141#endif /* ifndef __GNUC__ */
142
143#if (defined __digital__ && defined __unix__)
144# undef HAVE_MNTENT_H
145#else
146# define HAVE_MNTENT_H 1
147#endif /* ___digital__ && __unix__ */
148
149/*----- Kernel versioning ------------------------------------*/
150#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
151
152/* ---- miscellaneous --------------------------------------- */
153
154#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 5 && \
155 !defined(__dietlibc__) && \
156 !defined(_NEWLIB_VERSION) && \
157 !(defined __digital__ && defined __unix__)
158# error "Sorry, this libc version is not supported :("
159#endif
160
161// Don't perpetuate e2fsck crap into the headers. Clean up e2fsck instead.
162
163#if defined __GLIBC__ || defined __UCLIBC__ \
164 || defined __dietlibc__ || defined _NEWLIB_VERSION
165#include <features.h>
166#define HAVE_FEATURES_H
167#include <stdint.h>
168#define HAVE_STDINT_H
169#else
170/* Largest integral types. */
171#if __BIG_ENDIAN__
172typedef long int intmax_t;
173typedef unsigned long int uintmax_t;
174#else
175__extension__
176typedef long long int intmax_t;
177__extension__
178typedef unsigned long long int uintmax_t;
179#endif
180#endif
181
182/* uclibc does not implement daemon() for no-mmu systems.
183 * For 0.9.29 and svn, __ARCH_USE_MMU__ indicates no-mmu reliably.
184 * For earlier versions there is no reliable way to check if we are building
185 * for a mmu-less system; the user should pass EXTRA_CFLAGS="-DBB_NOMMU"
186 * on his own.
187 */
188#if defined __UCLIBC__ && __UCLIBC_MAJOR__ >= 0 && __UCLIBC_MINOR__ >= 9 && \
189 __UCLIBC_SUBLEVEL__ > 28 && !defined __ARCH_USE_MMU__
190#define BB_NOMMU
191#endif
192
193/* Platforms that haven't got dprintf need to implement fdprintf() in
194 * libbb. This would require a platform.c. It's not going to be cleaned
195 * out of the tree, so stop saying it should be. */
196#define fdprintf dprintf
197
198/* Don't use lchown with glibc older then 2.1.x ... uC-libc lacks it */
199#if (defined __GLIBC__ && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 1) || \
200 defined __UC_LIBC__
201# define lchown chown
202#endif
203
204/* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */
205/* FIXME: fix tar.c! */
206#ifndef FNM_LEADING_DIR
207#define FNM_LEADING_DIR 0
208#endif
209
210#if (defined __digital__ && defined __unix__)
211#include <standards.h>
212#define HAVE_STANDARDS_H
213#include <inttypes.h>
214#define HAVE_INTTYPES_H
215#define PRIu32 "u"
216
217/* use legacy setpgrp(pidt_,pid_t) for now. move to platform.c */
218#define bb_setpgrp do{pid_t __me = getpid();setpgrp(__me,__me);}while(0)
219
220#if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET
221#define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET)
222#endif
223#if !defined ADJ_FREQUENCY && defined MOD_FREQUENCY
224#define ADJ_FREQUENCY MOD_FREQUENCY
225#endif
226#if !defined ADJ_TIMECONST && defined MOD_TIMECONST
227#define ADJ_TIMECONST MOD_TIMECONST
228#endif
229#if !defined ADJ_TICK && defined MOD_CLKB
230#define ADJ_TICK MOD_CLKB
231#endif
232
233#else
234#define bb_setpgrp setpgrp()
235#endif
236
237#if defined(__linux__)
238#include <sys/mount.h>
239// Make sure we have all the new mount flags we actually try to use.
240#ifndef MS_BIND
241#define MS_BIND (1<<12)
242#endif
243#ifndef MS_MOVE
244#define MS_MOVE (1<<13)
245#endif
246#ifndef MS_RECURSIVE
247#define MS_RECURSIVE (1<<14)
248#endif
249#ifndef MS_SILENT
250#define MS_SILENT (1<<15)
251#endif
252
253// The shared subtree stuff, which went in around 2.6.15
254#ifndef MS_UNBINDABLE
255#define MS_UNBINDABLE (1<<17)
256#endif
257#ifndef MS_PRIVATE
258#define MS_PRIVATE (1<<18)
259#endif
260#ifndef MS_SLAVE
261#define MS_SLAVE (1<<19)
262#endif
263#ifndef MS_SHARED
264#define MS_SHARED (1<<20)
265#endif
266
267
268#if !defined(BLKSSZGET)
269#define BLKSSZGET _IO(0x12, 104)
270#endif
271#if !defined(BLKGETSIZE64)
272#define BLKGETSIZE64 _IOR(0x12,114,size_t)
273#endif
274#endif
275
276#endif /* platform.h */
diff --git a/include/pwd_.h b/include/pwd_.h
new file mode 100644
index 000000000..d161c0e8f
--- /dev/null
+++ b/include/pwd_.h
@@ -0,0 +1,107 @@
1/* vi: set sw=4 ts=4: */
2/* Copyright (C) 1991,92,95,96,97,98,99,2001 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
19
20/*
21 * POSIX Standard: 9.2.2 User Database Access <pwd.h>
22 */
23
24#if !defined CONFIG_USE_BB_PWD_GRP
25#include <pwd.h>
26
27#else
28
29#ifndef _PWD_H
30#define _PWD_H 1
31
32#include <sys/types.h>
33#include <features.h>
34#include <stdio.h>
35
36/* The passwd structure. */
37struct passwd
38{
39 char *pw_name; /* Username. */
40 char *pw_passwd; /* Password. */
41 uid_t pw_uid; /* User ID. */
42 gid_t pw_gid; /* Group ID. */
43 char *pw_gecos; /* Real name. */
44 char *pw_dir; /* Home directory. */
45 char *pw_shell; /* Shell program. */
46};
47
48
49/* Rewind the password-file stream. */
50extern void setpwent (void);
51
52/* Close the password-file stream. */
53extern void endpwent (void);
54
55/* Read an entry from the password-file stream, opening it if necessary. */
56extern struct passwd *getpwent (void);
57
58/* Read an entry from STREAM. */
59extern struct passwd *fgetpwent (FILE *__stream);
60
61/* Write the given entry onto the given stream. */
62extern int putpwent (__const struct passwd *__restrict __p,
63 FILE *__restrict __f);
64
65/* Search for an entry with a matching user ID. */
66extern struct passwd *getpwuid (uid_t __uid);
67
68/* Search for an entry with a matching username. */
69extern struct passwd *getpwnam (__const char *__name);
70
71/* Reentrant versions of some of the functions above.
72
73 PLEASE NOTE: the `getpwent_r' function is not (yet) standardized.
74 The interface may change in later versions of this library. But
75 the interface is designed following the principals used for the
76 other reentrant functions so the chances are good this is what the
77 POSIX people would choose. */
78
79extern int getpwent_r (struct passwd *__restrict __resultbuf,
80 char *__restrict __buffer, size_t __buflen,
81 struct passwd **__restrict __result);
82
83extern int getpwuid_r (uid_t __uid,
84 struct passwd *__restrict __resultbuf,
85 char *__restrict __buffer, size_t __buflen,
86 struct passwd **__restrict __result);
87
88extern int getpwnam_r (__const char *__restrict __name,
89 struct passwd *__restrict __resultbuf,
90 char *__restrict __buffer, size_t __buflen,
91 struct passwd **__restrict __result);
92
93
94/* Read an entry from STREAM. This function is not standardized and
95 probably never will. */
96extern int fgetpwent_r (FILE *__restrict __stream,
97 struct passwd *__restrict __resultbuf,
98 char *__restrict __buffer, size_t __buflen,
99 struct passwd **__restrict __result);
100
101/* Re-construct the password-file line for the given uid
102 in the given buffer. This knows the format that the caller
103 will expect, but this need not be the format of the password file. */
104extern int getpw (uid_t __uid, char *__buffer);
105
106#endif /* pwd.h */
107#endif
diff --git a/include/shadow_.h b/include/shadow_.h
new file mode 100644
index 000000000..177ee5f93
--- /dev/null
+++ b/include/shadow_.h
@@ -0,0 +1,99 @@
1/* vi: set sw=4 ts=4: */
2/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
19
20/* Declaration of types and functions for shadow password suite. */
21
22#if !defined CONFIG_USE_BB_SHADOW
23#include <shadow.h>
24#else
25
26#ifndef _SHADOW_H
27#define _SHADOW_H 1
28
29#include <stdio.h>
30
31/* Paths to the user database files. */
32#ifndef _PATH_SHADOW
33#define _PATH_SHADOW "/etc/shadow"
34#endif
35#define SHADOW _PATH_SHADOW
36
37
38/* Structure of the password file. */
39struct spwd
40{
41 char *sp_namp; /* Login name. */
42 char *sp_pwdp; /* Encrypted password. */
43 long int sp_lstchg; /* Date of last change. */
44 long int sp_min; /* Minimum number of days between changes. */
45 long int sp_max; /* Maximum number of days between changes. */
46 long int sp_warn; /* Number of days to warn user to change
47 the password. */
48 long int sp_inact; /* Number of days the account may be
49 inactive. */
50 long int sp_expire; /* Number of days since 1970-01-01 until
51 account expires. */
52 unsigned long int sp_flag; /* Reserved. */
53};
54
55
56/* Open database for reading. */
57extern void setspent (void);
58
59/* Close database. */
60extern void endspent (void);
61
62/* Get next entry from database, perhaps after opening the file. */
63extern struct spwd *getspent (void);
64
65/* Get shadow entry matching NAME. */
66extern struct spwd *getspnam (__const char *__name);
67
68/* Read shadow entry from STRING. */
69extern struct spwd *sgetspent (__const char *__string);
70
71/* Read next shadow entry from STREAM. */
72extern struct spwd *fgetspent (FILE *__stream);
73
74/* Write line containing shadow password entry to stream. */
75extern int putspent (__const struct spwd *__p, FILE *__stream);
76
77/* Reentrant versions of some of the functions above. */
78extern int getspent_r (struct spwd *__result_buf, char *__buffer,
79 size_t __buflen, struct spwd **__result);
80
81extern int getspnam_r (__const char *__name, struct spwd *__result_buf,
82 char *__buffer, size_t __buflen,
83 struct spwd **__result);
84
85extern int sgetspent_r (__const char *__string, struct spwd *__result_buf,
86 char *__buffer, size_t __buflen,
87 struct spwd **__result);
88
89extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf,
90 char *__buffer, size_t __buflen,
91 struct spwd **__result);
92/* Protect password file against multi writers. */
93extern int lckpwdf (void);
94
95/* Unlock password file. */
96extern int ulckpwdf (void);
97
98#endif /* shadow.h */
99#endif
diff --git a/include/unarchive.h b/include/unarchive.h
new file mode 100644
index 000000000..7de6a63fe
--- /dev/null
+++ b/include/unarchive.h
@@ -0,0 +1,114 @@
1/* vi: set sw=4 ts=4: */
2#ifndef __UNARCHIVE_H__
3#define __UNARCHIVE_H__
4
5#define ARCHIVE_PRESERVE_DATE 1
6#define ARCHIVE_CREATE_LEADING_DIRS 2
7#define ARCHIVE_EXTRACT_UNCONDITIONAL 4
8#define ARCHIVE_EXTRACT_QUIET 8
9#define ARCHIVE_EXTRACT_NEWER 16
10#define ARCHIVE_NOPRESERVE_OWN 32
11#define ARCHIVE_NOPRESERVE_PERM 64
12
13#include "libbb.h"
14
15typedef struct file_headers_s {
16 char *name;
17 char *link_name;
18 off_t size;
19 uid_t uid;
20 gid_t gid;
21 mode_t mode;
22 time_t mtime;
23 dev_t device;
24} file_header_t;
25
26typedef struct archive_handle_s {
27 /* define if the header and data component should processed */
28 char (*filter)(struct archive_handle_s *);
29 llist_t *accept;
30 /* List of files that have been rejected */
31 llist_t *reject;
32 /* List of files that have successfully been worked on */
33 llist_t *passed;
34
35 /* Contains the processed header entry */
36 file_header_t *file_header;
37
38 /* process the header component, e.g. tar -t */
39 void (*action_header)(const file_header_t *);
40
41 /* process the data component, e.g. extract to filesystem */
42 void (*action_data)(struct archive_handle_s *);
43
44 /* How to process any sub archive, e.g. get_header_tar_gz */
45 char (*action_data_subarchive)(struct archive_handle_s *);
46
47 /* Contains the handle to a sub archive */
48 struct archive_handle_s *sub_archive;
49
50 /* The raw stream as read from disk or stdin */
51 int src_fd;
52
53 /* Count the number of bytes processed */
54 off_t offset;
55
56 /* Function that skips data: read_by_char or read_by_skip */
57 void (*seek)(const struct archive_handle_s *archive_handle, const unsigned int amount);
58
59 /* Temporary storage */
60 char *buffer;
61
62 /* Flags and misc. stuff */
63 unsigned char flags;
64
65} archive_handle_t;
66
67extern archive_handle_t *init_handle(void);
68
69extern char filter_accept_all(archive_handle_t *archive_handle);
70extern char filter_accept_list(archive_handle_t *archive_handle);
71extern char filter_accept_list_reassign(archive_handle_t *archive_handle);
72extern char filter_accept_reject_list(archive_handle_t *archive_handle);
73
74extern void unpack_ar_archive(archive_handle_t *ar_archive);
75
76extern void data_skip(archive_handle_t *archive_handle);
77extern void data_extract_all(archive_handle_t *archive_handle);
78extern void data_extract_to_stdout(archive_handle_t *archive_handle);
79extern void data_extract_to_buffer(archive_handle_t *archive_handle);
80
81extern void header_skip(const file_header_t *file_header);
82extern void header_list(const file_header_t *file_header);
83extern void header_verbose_list(const file_header_t *file_header);
84
85extern void check_header_gzip(int src_fd);
86
87extern char get_header_ar(archive_handle_t *archive_handle);
88extern char get_header_cpio(archive_handle_t *archive_handle);
89extern char get_header_tar(archive_handle_t *archive_handle);
90extern char get_header_tar_bz2(archive_handle_t *archive_handle);
91extern char get_header_tar_lzma(archive_handle_t *archive_handle);
92extern char get_header_tar_gz(archive_handle_t *archive_handle);
93
94extern void seek_by_jump(const archive_handle_t *archive_handle, const unsigned int amount);
95extern void seek_by_read(const archive_handle_t *archive_handle, const unsigned int amount);
96
97extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned char *buf, size_t count);
98
99extern void data_align(archive_handle_t *archive_handle, const unsigned short boundary);
100extern const llist_t *find_list_entry(const llist_t *list, const char *filename);
101extern const llist_t *find_list_entry2(const llist_t *list, const char *filename);
102
103extern USE_DESKTOP(long long) int uncompressStream(int src_fd, int dst_fd);
104extern void inflate_init(unsigned int bufsize);
105extern void inflate_cleanup(void);
106extern USE_DESKTOP(long long) int inflate_unzip(int in, int out);
107extern USE_DESKTOP(long long) int inflate_gunzip(int in, int out);
108extern USE_DESKTOP(long long) int unlzma(int src_fd, int dst_fd);
109
110extern int open_transformer(int src_fd,
111 USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd));
112
113
114#endif
diff --git a/include/usage.h b/include/usage.h
new file mode 100644
index 000000000..0fba9b848
--- /dev/null
+++ b/include/usage.h
@@ -0,0 +1,3495 @@
1/* vi: set sw=8 ts=8: */
2/*
3 * This file suffers from chronically incorrect tabification
4 * of messages. Before editing this file:
5 * 1. Switch you editor to 8-space tab mode.
6 * 2. Do not use \t in messages, use real tab character.
7 * 3. Start each source line with message as follows:
8 * |<7 spaces>"text with tabs"....
9 */
10
11#ifndef __BB_USAGE_H__
12#define __BB_USAGE_H__
13
14#define addgroup_trivial_usage \
15 "[-g GID] group_name [user_name]"
16#define addgroup_full_usage \
17 "Adds a group to the system\n\n" \
18 "Options:\n" \
19 " -g GID specify gid"
20
21#define adduser_trivial_usage \
22 "[OPTIONS] user_name"
23#define adduser_full_usage \
24 "Adds a user to the system\n\n" \
25 "Options:\n" \
26 " -h DIR Assign home directory DIR\n" \
27 " -g GECOS Assign gecos field GECOS\n" \
28 " -s SHELL Assign login shell SHELL\n" \
29 " -G Add the user to existing group GROUP\n" \
30 " -S create a system user (ignored)\n" \
31 " -D Do not assign a password (logins still possible via ssh)\n" \
32 " -H Do not create the home directory"
33
34#define adjtimex_trivial_usage \
35 "[-q] [-o offset] [-f frequency] [-p timeconstant] [-t tick]"
36#define adjtimex_full_usage \
37 "Reads and optionally sets system timebase parameters.\n" \
38 "See adjtimex(2).\n\n" \
39 "Options:\n" \
40 " -q quiet mode - do not print\n" \
41 " -o offset time offset, microseconds\n" \
42 " -f frequency frequency adjust, integer kernel units (65536 is 1ppm)\n" \
43 " (positive values make the system clock run fast)\n" \
44 " -t tick microseconds per tick, usually 10000\n" \
45 " -p timeconstant"
46
47#define ar_trivial_usage \
48 "[-o] [-v] [-p] [-t] [-x] ARCHIVE FILES"
49#define ar_full_usage \
50 "Extract or list FILES from an ar archive.\n\n" \
51 "Options:\n" \
52 " -o preserve original dates\n" \
53 " -p extract to stdout\n" \
54 " -t list\n" \
55 " -x extract\n" \
56 " -v verbosely list files processed"
57
58#define arping_trivial_usage \
59 "[-fqbDUA] [-c count] [-w timeout] [-i device] [-s sender] target"
60#define arping_full_usage \
61 "Ping hosts by ARP requests/replies.\n\n" \
62 "Options:\n" \
63 " -f Quit on first ARP reply\n" \
64 " -q Be quiet\n" \
65 " -b Keep broadcasting, don't go unicast\n" \
66 " -D Duplicated address detection mode\n" \
67 " -U Unsolicited ARP mode, update your neighbours\n" \
68 " -A ARP answer mode, update your neighbours\n" \
69 " -c count Stop after sending count ARP request packets\n" \
70 " -w timeout Time to wait for ARP reply, in seconds\n" \
71 " -i device Outgoing interface name, default is eth0\n" \
72 " -s sender Set specific sender IP address\n" \
73 " target Target IP address of ARP request"
74
75#define ash_trivial_usage \
76 "[FILE]...\n" \
77 "or: ash -c command [args]..."
78#define ash_full_usage \
79 "The ash shell (command interpreter)"
80
81#define awk_trivial_usage \
82 "[OPTION]... [program-text] [FILE ...]"
83#define awk_full_usage \
84 "Options:\n" \
85 " -v var=val assign value 'val' to variable 'var'\n" \
86 " -F sep use 'sep' as field separator\n" \
87 " -f progname read program source from file 'progname'"
88
89#define basename_trivial_usage \
90 "FILE [SUFFIX]"
91#define basename_full_usage \
92 "Strips directory path and suffixes from FILE.\n" \
93 "If specified, also removes any trailing SUFFIX."
94#define basename_example_usage \
95 "$ basename /usr/local/bin/foo\n" \
96 "foo\n" \
97 "$ basename /usr/local/bin/\n" \
98 "bin\n" \
99 "$ basename /foo/bar.txt .txt\n" \
100 "bar"
101
102#define bunzip2_trivial_usage \
103 "[OPTION]... [FILE]"
104#define bunzip2_full_usage \
105 "Uncompress FILE (or standard input if FILE is '-' or omitted).\n\n" \
106 "Options:\n" \
107 " -c Write output to standard output\n" \
108 " -f Force"
109
110#define busybox_notes_usage \
111 "Hello world!\n"
112
113#define bzcat_trivial_usage \
114 "FILE"
115#define bzcat_full_usage \
116 "Uncompress to stdout."
117
118#define unlzma_trivial_usage \
119 "[OPTION]... [FILE]"
120#define unlzma_full_usage \
121 "Uncompress FILE (or standard input if FILE is '-' or omitted).\n\n" \
122 "Options:\n" \
123 " -c Write output to standard output\n" \
124 " -f Force"
125
126#define lzmacat_trivial_usage \
127 "FILE"
128#define lzmacat_full_usage \
129 "Uncompress to stdout."
130
131#define cal_trivial_usage \
132 "[-jy] [[month] year]"
133#define cal_full_usage \
134 "Display a calendar.\n" \
135 "\nOptions:\n" \
136 " -j Use julian dates\n" \
137 " -y Display the entire year"
138
139#define cat_trivial_usage \
140 "[-u] [FILE]..."
141#define cat_full_usage \
142 "Concatenates FILE(s) and prints them to stdout.\n\n" \
143 "Options:\n" \
144 " -u ignored since unbuffered i/o is always used"
145#define cat_example_usage \
146 "$ cat /proc/uptime\n" \
147 "110716.72 17.67"
148
149#define catv_trivial_usage \
150 "[-etv] [FILE]..."
151#define catv_full_usage \
152 "Display nonprinting characters as ^x or M-x.\n\n"\
153 " -e End each line with $\n" \
154 " -t Show tabs as ^I\n" \
155 " -v Don't use ^x or M-x escapes."
156#define chattr_trivial_usage \
157 "[-R] [-+=AacDdijsStTu] [-v version] files..."
158#define chattr_full_usage \
159 "change file attributes on an ext2 fs\n\n" \
160 "Modifiers:\n" \
161 " - remove attributes\n" \
162 " + add attributes\n" \
163 " = set attributes\n" \
164 "Attributes:\n" \
165 " A don't track atime\n" \
166 " a append mode only\n" \
167 " c enable compress\n" \
168 " D write dir contents synchronously\n" \
169 " d do not backup with dump\n" \
170 " i cannot be modified (immutable)\n" \
171 " j write all data to journal first\n" \
172 " s zero disk storage when deleted\n" \
173 " S write file contents synchronously\n" \
174 " t disable tail-merging of partial blocks with other files\n" \
175 " u allow file to be undeleted\n" \
176 "Options:\n" \
177 " -R recursively list subdirectories\n" \
178 " -v set the file's version/generation number"
179
180#define chgrp_trivial_usage \
181 "[-Rh"USE_DESKTOP("cvf")"]... GROUP FILE..."
182#define chgrp_full_usage \
183 "Change the group membership of each FILE to GROUP.\n" \
184 "\nOptions:\n" \
185 " -R Changes files and directories recursively\n" \
186 " -h Do not dereference symbolic links" \
187 USE_DESKTOP( \
188 "\n -c List changed files" \
189 "\n -v List all files" \
190 "\n -f Hide errors" \
191 )
192#define chgrp_example_usage \
193 "$ ls -l /tmp/foo\n" \
194 "-r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo\n" \
195 "$ chgrp root /tmp/foo\n" \
196 "$ ls -l /tmp/foo\n" \
197 "-r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo\n"
198
199#define chmod_trivial_usage \
200 "[-R"USE_DESKTOP("cvf")"] MODE[,MODE]... FILE..."
201#define chmod_full_usage \
202 "Each MODE is one or more of the letters ugoa, one of the\n" \
203 "symbols +-= and one or more of the letters rwxst.\n\n" \
204 "Options:\n" \
205 " -R Changes files and directories recursively" \
206 USE_DESKTOP( \
207 "\n -c List changed files" \
208 "\n -v List all files" \
209 "\n -f Hide errors" \
210 )
211#define chmod_example_usage \
212 "$ ls -l /tmp/foo\n" \
213 "-rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo\n" \
214 "$ chmod u+x /tmp/foo\n" \
215 "$ ls -l /tmp/foo\n" \
216 "-rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*\n" \
217 "$ chmod 444 /tmp/foo\n" \
218 "$ ls -l /tmp/foo\n" \
219 "-r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo\n"
220
221#define chown_trivial_usage \
222 "[-Rh"USE_DESKTOP("cvf")"]... OWNER[<.|:>[GROUP]] FILE..."
223#define chown_full_usage \
224 "Change the owner and/or group of each FILE to OWNER and/or GROUP.\n" \
225 "\nOptions:\n" \
226 " -R Changes files and directories recursively\n" \
227 " -h Do not dereference symbolic links" \
228 USE_DESKTOP( \
229 "\n -c List changed files" \
230 "\n -v List all files" \
231 "\n -f Hide errors" \
232 )
233#define chown_example_usage \
234 "$ ls -l /tmp/foo\n" \
235 "-r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo\n" \
236 "$ chown root /tmp/foo\n" \
237 "$ ls -l /tmp/foo\n" \
238 "-r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo\n" \
239 "$ chown root.root /tmp/foo\n" \
240 "ls -l /tmp/foo\n" \
241 "-r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo\n"
242
243#define chpst_trivial_usage \
244 "[-vP012] [-u user[:group]] [-U user[:group]] [-e dir] " \
245 "[-/ dir] [-n nice] [-m bytes] [-d bytes] [-o files] " \
246 "[-p processes] [-f bytes] [-c bytes] prog args"
247#define chpst_full_usage \
248 "Change the process state and run specified program.\n\n" \
249 "-u user[:grp] set uid and gid\n" \
250 "-U user[:grp] set environment variables UID and GID\n" \
251 "-e dir set environment variables as specified by files\n" \
252 " in the directory: file=1st_line_of_file\n" \
253 "-/ dir chroot to dir\n" \
254 "-n inc add inc to nice value\n" \
255 "-m bytes limit data segment, stack segment, locked physical pages,\n" \
256 " and total of all segment per process to bytes bytes each\n" \
257 "-d bytes limit data segment\n" \
258 "-o n limit the number of open file descriptors per process to n\n" \
259 "-p n limit number of processes per uid to n\n" \
260 "-f bytes limit output file size to bytes bytes\n" \
261 "-c bytes limit core file size to bytes bytes\n" \
262 "-v verbose\n" \
263 "-P run prog in a new process group\n" \
264 "-0 close standard input\n" \
265 "-1 close standard output\n" \
266 "-2 close standard error"
267#define setuidgid_trivial_usage \
268 "account prog args"
269#define setuidgid_full_usage \
270 "Sets uid and gid to account's uid and gid, removing all supplementary\n" \
271 "groups, then runs prog"
272#define envuidgid_trivial_usage \
273 "account prog args"
274#define envuidgid_full_usage \
275 "Sets $UID to account's uid and $GID to account's gid, then runs prog"
276#define envdir_trivial_usage \
277 "dir prog args"
278#define envdir_full_usage \
279 "Sets various environment variables as specified by files\n" \
280 "in the directory dir, then runs prog"
281#define softlimit_trivial_usage \
282 "[-a allbytes] [-c corebytes] [-d databytes] [-f filebytes] " \
283 "[-l lockbytes] [-m membytes] [-o openfiles] [-p processes] " \
284 "[-r residentbytes] [-s stackbytes] [-t cpusecs] prog args"
285#define softlimit_full_usage \
286 "Sets soft resource limits as specified by options, then runs prog\n" \
287 "\n" \
288 "-m n Same as -d n -s n -l n -a n\n" \
289 "-d n Limit the data segment per process to n bytes\n" \
290 "-s n Limit the stack segment per process to n bytes\n" \
291 "-l n Limit the locked physical pages per process to n bytes\n" \
292 "-a n Limit the total of all segments per process to n bytes\n" \
293 "-o n Limit the number of open file descriptors per process to n\n" \
294 "-p n Limit the number of processes per uid to n\n" \
295 "Options controlling file sizes:\n" \
296 "-f n Limit output file sizes to n bytes\n" \
297 "-c n Limit core file sizes to n bytes\n" \
298 "Efficiency opts:\n" \
299 "-r n Limit the resident set size to n bytes. This limit is not\n" \
300 " enforced unless physical memory is full\n" \
301 "-t n Limit the CPU time to n seconds. This limit is not enforced\n" \
302 " except that the process receives a SIGXCPU signal after n seconds\n" \
303 "\n" \
304 "Some options may have no effect on some operating systems\n" \
305 "n may be =, indicating that soft limit should be set equal to hard limit"
306
307#define chroot_trivial_usage \
308 "NEWROOT [COMMAND...]"
309#define chroot_full_usage \
310 "Run COMMAND with root directory set to NEWROOT."
311#define chroot_example_usage \
312 "$ ls -l /bin/ls\n" \
313 "lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox\n" \
314 "# mount /dev/hdc1 /mnt -t minix\n" \
315 "# chroot /mnt\n" \
316 "# ls -l /bin/ls\n" \
317 "-rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*\n"
318
319#define chvt_trivial_usage \
320 "N"
321#define chvt_full_usage \
322 "Changes the foreground virtual terminal to /dev/ttyN"
323
324#define cksum_trivial_usage \
325 "FILES..."
326#define cksum_full_usage \
327 "Calculates the CRC32 checksums of FILES."
328
329#define clear_trivial_usage \
330 ""
331#define clear_full_usage \
332 "Clear screen."
333
334#define cmp_trivial_usage \
335 "[-l] [-s] FILE1 [FILE2]"
336#define cmp_full_usage \
337 "Compares FILE1 vs stdin if FILE2 is not specified.\n\n" \
338 "Options:\n" \
339 " -l Write the byte numbers (decimal) and values (octal)\n" \
340 " for all differing bytes\n" \
341 " -s quiet mode - do not print"
342
343#define comm_trivial_usage \
344 "[-123] FILE1 FILE2"
345#define comm_full_usage \
346 "Compares FILE1 to FILE2, or to stdin if = is specified.\n\n" \
347 "Options:\n" \
348 " -1 Suppress lines unique to FILE1\n" \
349 " -2 Suppress lines unique to FILE2\n" \
350 " -3 Suppress lines common to both files"
351
352#define bbconfig_trivial_usage \
353 ""
354#define bbconfig_full_usage \
355 "Print the config file which built busybox"
356
357#define bbsh_trivial_usage \
358 "[FILE]...\n" \
359 "or: bbsh -c command [args]..."
360#define bbsh_full_usage \
361 "The bbsh shell (command interpreter)"
362
363#define cp_trivial_usage \
364 "[OPTION]... SOURCE DEST"
365#define cp_full_usage \
366 "Copies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n" \
367 "\n" \
368 " -a Same as -dpR\n" \
369 " -d,-P Preserve links\n" \
370 " -H,-L Dereference all symlinks (implied by default)\n" \
371 " -p Preserve file attributes if possible\n" \
372 " -f force, overwrite\n" \
373 " -i interactive, prompt before overwrite\n" \
374 " -R,-r Copy directories recursively\n" \
375 " -l,-s Create (sym)links"
376
377#define cpio_trivial_usage \
378 "-[dimtuv][F cpiofile]"
379#define cpio_full_usage \
380 "Extract or list files from a cpio archive\n" \
381 "Main operation mode:\n" \
382 " d make leading directories\n" \
383 " i extract\n" \
384 " m preserve mtime\n" \
385 " t list\n" \
386 " v verbose\n" \
387 " u unconditional overwrite\n" \
388 " F input from file"
389
390#define crond_trivial_usage \
391 "-d[#] -c <crondir> -f -b"
392#define crond_full_usage \
393 " -d [#] -l [#] -S -L logfile -f -b -c dir\n" \
394 " -d num debug level\n" \
395 " -l num log level (8 - default)\n" \
396 " -S log to syslogd (default)\n" \
397 " -L file log to file\n" \
398 " -f run in foreground\n" \
399 " -b run in background (default)\n" \
400 " -c dir working dir"
401
402#define crontab_trivial_usage \
403 "[-c dir] {file|-}|[-u|-l|-e|-d user]"
404#define crontab_full_usage \
405 " file <opts> replace crontab from file\n" \
406 " - <opts> replace crontab from stdin\n" \
407 " -u user specify user\n" \
408 " -l [user] list crontab for user\n" \
409 " -e [user] edit crontab for user\n" \
410 " -d [user] delete crontab for user\n" \
411 " -c dir specify crontab directory"
412
413
414#define cut_trivial_usage \
415 "[OPTION]... [FILE]..."
416#define cut_full_usage \
417 "Prints selected fields from each input FILE to standard output.\n\n" \
418 "Options:\n" \
419 " -b LIST Output only bytes from LIST\n" \
420 " -c LIST Output only characters from LIST\n" \
421 " -d CHAR Use CHAR instead of tab as the field delimiter\n" \
422 " -s Output only the lines containing delimiter\n" \
423 " -f N Print only these fields\n" \
424 " -n Ignored"
425#define cut_example_usage \
426 "$ echo \"Hello world\" | cut -f 1 -d ' '\n" \
427 "Hello\n" \
428 "$ echo \"Hello world\" | cut -f 2 -d ' '\n" \
429 "world\n"
430
431#define date_trivial_usage \
432 "[OPTION]... [MMDDhhmm[[CC]YY][.ss]] [+FORMAT]"
433#define date_full_usage \
434 "Displays the current time in the given FORMAT, or sets the system date.\n" \
435 "\nOptions:\n" \
436 " -R Outputs RFC-822 compliant date string\n" \
437 " -d STRING Displays time described by STRING, not 'now'\n" \
438USE_FEATURE_DATE_ISOFMT( \
439 " -I[TIMESPEC] Outputs an ISO-8601 compliant date/time string\n" \
440 " TIMESPEC='date' (or missing) for date only,\n" \
441 " 'hours', 'minutes', or 'seconds' for date and,\n" \
442 " time to the indicated precision\n" \
443 " -D hint Use 'hint' as date format, via strptime()\n" \
444) \
445 " -s Sets time described by STRING\n" \
446 " -r FILE Displays the last modification time of FILE\n" \
447 " -u Prints or sets Coordinated Universal Time"
448#define date_example_usage \
449 "$ date\n" \
450 "Wed Apr 12 18:52:41 MDT 2000\n"
451
452#define dc_trivial_usage \
453 "expression ..."
454#define dc_full_usage \
455 "This is a Tiny RPN calculator that understands the\n" \
456 "following operations: +, add, -, sub, *, mul, /, div, %, mod, " \
457 "**, exp, and, or, not, eor.\n" \
458 "For example: 'dc 2 2 add' -> 4, and 'dc 8 8 \\* 2 2 + /' -> 16.\n" \
459 "\nOptions:\n" \
460 "p - Prints the value on the top of the stack, without altering the stack\n" \
461 "f - Prints the entire contents of the stack without altering anything\n" \
462 "o - Pops the value off the top of the stack and uses it to set the output radix\n" \
463 " Only 10 and 16 are supported"
464#define dc_example_usage \
465 "$ dc 2 2 + p\n" \
466 "4\n" \
467 "$ dc 8 8 \\* 2 2 + / p\n" \
468 "16\n" \
469 "$ dc 0 1 and p\n" \
470 "0\n" \
471 "$ dc 0 1 or p\n" \
472 "1\n" \
473 "$ echo 72 9 div 8 mul p | dc\n" \
474 "64\n"
475
476#define dd_trivial_usage \
477 "[if=FILE] [of=FILE] " USE_FEATURE_DD_IBS_OBS("[ibs=N] [obs=N] ") "[bs=N] [count=N] [skip=N]\n" \
478 " [seek=N]" USE_FEATURE_DD_IBS_OBS(" [conv=notrunc|noerror|sync]")
479#define dd_full_usage \
480 "Copy a file, converting and formatting according to options\n\n" \
481 " if=FILE read from FILE instead of stdin\n" \
482 " of=FILE write to FILE instead of stdout\n" \
483 " bs=N read and write N bytes at a time\n" \
484 USE_FEATURE_DD_IBS_OBS( \
485 " ibs=N read N bytes at a time\n") \
486 USE_FEATURE_DD_IBS_OBS( \
487 " obs=N write N bytes at a time\n") \
488 " count=N copy only N input blocks\n" \
489 " skip=N skip N input blocks\n" \
490 " seek=N skip N output blocks\n" \
491 USE_FEATURE_DD_IBS_OBS( \
492 " conv=notrunc don't truncate output file\n" \
493 " conv=noerror continue after read errors\n" \
494 " conv=sync pad blocks with zeros\n") \
495 "\n" \
496 "Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024),\n" \
497 "MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824)"
498#define dd_example_usage \
499 "$ dd if=/dev/zero of=/dev/ram1 bs=1M count=4\n" \
500 "4+0 records in\n" \
501 "4+0 records out\n"
502
503#define deallocvt_trivial_usage \
504 "[N]"
505#define deallocvt_full_usage \
506 "Deallocate unused virtual terminal /dev/ttyN"
507
508#define delgroup_trivial_usage \
509 "GROUP"
510#define delgroup_full_usage \
511 "Deletes group GROUP from the system"
512
513#define deluser_trivial_usage \
514 "USER"
515#define deluser_full_usage \
516 "Deletes user USER from the system"
517
518#define devfsd_trivial_usage \
519 "mntpnt [-v]" \
520 USE_DEVFSD_FG_NP("[-fg][-np]" )
521#define devfsd_full_usage \
522 "Optional daemon for managing devfs permissions and old device name symlinks.\n" \
523 "\nOptions:\n" \
524 " mntpnt The mount point where devfs is mounted.\n\n" \
525 " -v Print the protocol version numbers for devfsd\n" \
526 " and the kernel-side protocol version and exits." \
527 USE_DEVFSD_FG_NP( "\n\n -fg Run the daemon in the foreground.\n\n" \
528 " -np Exit after parsing the configuration file\n" \
529 " and processing synthetic REGISTER events.\n" \
530 " Do not poll for events.")
531
532#define df_trivial_usage \
533 "[-" USE_FEATURE_HUMAN_READABLE("hm") "k] [FILESYSTEM ...]"
534#define df_full_usage \
535 "Print the filesystem space used and space available.\n\n" \
536 "Options:\n" \
537 USE_FEATURE_HUMAN_READABLE( \
538 "\n -h print sizes in human readable format (e.g., 1K 243M 2G )\n" \
539 " -m print sizes in megabytes\n" \
540 " -k print sizes in kilobytes(default)") \
541 SKIP_FEATURE_HUMAN_READABLE("\n -k ignored")
542#define df_example_usage \
543 "$ df\n" \
544 "Filesystem 1k-blocks Used Available Use% Mounted on\n" \
545 "/dev/sda3 8690864 8553540 137324 98% /\n" \
546 "/dev/sda1 64216 36364 27852 57% /boot\n" \
547 "$ df /dev/sda3\n" \
548 "Filesystem 1k-blocks Used Available Use% Mounted on\n" \
549 "/dev/sda3 8690864 8553540 137324 98% /\n"
550
551#define dhcprelay_trivial_usage \
552 "[client_device_list] [server_device]"
553#define dhcprelay_full_usage \
554 "Relays dhcp requests from client devices to server device"
555
556#define dhcprelay_trivial_usage \
557 "[client_device_list] [server_device]"
558#define dhcprelay_full_usage \
559 "Relays dhcp requests from client devices to server device"
560
561#define diff_trivial_usage \
562 "[-abdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2"
563#define diff_full_usage \
564 "Compare files line by line and output the differences between them.\n" \
565 "This diff implementation only supports unified diffs.\n\n" \
566 "Options:\n" \
567 " -a Treat all files as text\n" \
568 " -b Ignore changes in the amount of whitespace\n" \
569 " -d Try hard to find a smaller set of changes\n" \
570 " -i Ignore case differences\n" \
571 " -L Use LABEL instead of the filename in the unified header\n" \
572 " -N Treat absent files as empty\n" \
573 " -q Output only whether files differ\n" \
574 " -r Recursively compare any subdirectories\n" \
575 " -S Start with FILE when comparing directories\n" \
576 " -T Make tabs line up by prefixing a tab when necessary\n" \
577 " -s Report when two files are the same\n" \
578 " -t Expand tabs to spaces in output\n" \
579 " -U Output LINES lines of context\n" \
580 " -w Ignore all whitespace\n"
581
582#define dirname_trivial_usage \
583 "FILENAME"
584#define dirname_full_usage \
585 "Strips non-directory suffix from FILENAME"
586#define dirname_example_usage \
587 "$ dirname /tmp/foo\n" \
588 "/tmp\n" \
589 "$ dirname /tmp/foo/\n" \
590 "/tmp\n"
591
592#define dmesg_trivial_usage \
593 "[-c] [-n LEVEL] [-s SIZE]"
594#define dmesg_full_usage \
595 "Prints or controls the kernel ring buffer\n\n" \
596 "Options:\n" \
597 " -c Clears the ring buffer's contents after printing\n" \
598 " -n LEVEL Sets console logging level\n" \
599 " -s SIZE Use a buffer of size SIZE"
600
601#define dnsd_trivial_usage \
602 "[-c config] [-t seconds] [-p port] [-i iface-ip] [-d]"
603#define dnsd_full_usage \
604 "Small and static DNS server daemon\n\n" \
605 "Options:\n" \
606 " -c config filename\n" \
607 " -t TTL in seconds\n" \
608 " -p listening port\n" \
609 " -i listening iface ip (default all)\n" \
610 " -d daemonize"
611
612#define dos2unix_trivial_usage \
613 "[option] [FILE]"
614#define dos2unix_full_usage \
615 "Converts FILE from dos format to unix format. When no option\n" \
616 "is given, the input is converted to the opposite output format.\n" \
617 "When no file is given, uses stdin for input and stdout for output.\n\n" \
618 "Options:\n" \
619 " -u output will be in UNIX format\n" \
620 " -d output will be in DOS format"
621
622#define dpkg_trivial_usage \
623 "[-ilCPru] [-F option] package_name"
624#define dpkg_full_usage \
625 "dpkg is a utility to install, remove and manage Debian packages.\n\n" \
626 "Options:\n" \
627 " -i Install the package\n" \
628 " -l List of installed packages\n" \
629 " -C Configure an unpackaged package\n" \
630 " -F depends Ignore dependency problems\n" \
631 " -P Purge all files of a package\n" \
632 " -r Remove all but the configuration files for a package\n" \
633 " -u Unpack a package, but don't configure it"
634
635#define dpkg_deb_trivial_usage \
636 "[-cefxX] FILE [argument]"
637#define dpkg_deb_full_usage \
638 "Perform actions on Debian packages (.debs)\n\n" \
639 "Options:\n" \
640 " -c List contents of filesystem tree\n" \
641 " -e Extract control files to [argument] directory\n" \
642 " -f Display control field name starting with [argument]\n" \
643 " -x Extract packages filesystem tree to directory\n" \
644 " -X Verbose extract"
645#define dpkg_deb_example_usage \
646 "$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n"
647
648#define du_trivial_usage \
649 "[-aHLdclsx" USE_FEATURE_HUMAN_READABLE("hm") "k] [FILE]..."
650#define du_full_usage \
651 "Summarizes disk space used for each FILE and/or directory.\n" \
652 "Disk space is printed in units of " \
653 USE_FEATURE_DU_DEFAULT_BLOCKSIZE_1K("1024") \
654 SKIP_FEATURE_DU_DEFAULT_BLOCKSIZE_1K("512") \
655 " bytes.\n\n" \
656 "Options:\n" \
657 " -a show sizes of files in addition to directories\n" \
658 " -H follow symbolic links that are FILE command line args\n" \
659 " -L follow all symbolic links encountered\n" \
660 " -d N limit output to directories (and files with -a) of depth < N\n" \
661 " -c output a grand total\n" \
662 " -l count sizes many times if hard linked\n" \
663 " -s display only a total for each argument\n" \
664 " -x skip directories on different filesystems\n" \
665 USE_FEATURE_HUMAN_READABLE( \
666 " -h print sizes in human readable format (e.g., 1K 243M 2G )\n" \
667 " -m print sizes in megabytes\n" \
668 ) \
669 " -k print sizes in kilobytes" \
670 USE_FEATURE_DU_DEFAULT_BLOCKSIZE_1K("(default)")
671#define du_example_usage \
672 "$ du\n" \
673 "16 ./CVS\n" \
674 "12 ./kernel-patches/CVS\n" \
675 "80 ./kernel-patches\n" \
676 "12 ./tests/CVS\n" \
677 "36 ./tests\n" \
678 "12 ./scripts/CVS\n" \
679 "16 ./scripts\n" \
680 "12 ./docs/CVS\n" \
681 "104 ./docs\n" \
682 "2417 .\n"
683
684#define dumpkmap_trivial_usage \
685 "> keymap"
686#define dumpkmap_full_usage \
687 "Prints out a binary keyboard translation table to standard output."
688#define dumpkmap_example_usage \
689 "$ dumpkmap > keymap\n"
690
691#define dumpleases_trivial_usage \
692 "[-r|-a] [-f LEASEFILE]"
693#define dumpleases_full_usage \
694 "Displays the DHCP leases granted by udhcpd.\n\n" \
695 "Options:\n" \
696 " -f, --file=FILENAME Leases file to load\n" \
697 " -r, --remaining Interpret lease times as time remaining\n" \
698 " -a, --absolute Interpret lease times as expire time"
699
700#define e2fsck_trivial_usage \
701 "[-panyrcdfvstDFSV] [-b superblock] [-B blocksize] " \
702 "[-I inode_buffer_blocks] [-P process_inode_size] " \
703 "[-l|-L bad_blocks_file] [-C fd] [-j external_journal] " \
704 "[-E extended-options] device"
705#define e2fsck_full_usage \
706 "Check a Linux ext2/ext3 file system.\n\n" \
707 "Options:\n" \
708 " -p Automatic repair (no questions)\n" \
709 " -n Make no changes to the filesystem\n" \
710 " -y Assume 'yes' to all questions\n" \
711 " -c Check for bad blocks and add them to the badblock list\n" \
712 " -f Force checking even if filesystem is marked clean\n" \
713 " -v Be verbose\n" \
714 " -b superblock Use alternative superblock\n" \
715 " -B blocksize Force blocksize when looking for superblock\n" \
716 " -j journal Set location of the external journal\n" \
717 " -l file Add to badblocks list\n" \
718 " -L file Set badblocks list"
719
720#define echo_trivial_usage \
721 USE_FEATURE_FANCY_ECHO("[-neE] ") "[ARG ...]"
722#define echo_full_usage \
723 "Prints the specified ARGs to stdout\n\n" \
724 USE_FEATURE_FANCY_ECHO( \
725 "Options:\n" \
726 " -n suppress trailing newline\n" \
727 " -e interpret backslash-escaped characters (i.e., \\t=tab)\n" \
728 " -E disable interpretation of backslash-escaped characters" \
729 )
730#define echo_example_usage \
731 "$ echo \"Erik is cool\"\n" \
732 "Erik is cool\n" \
733 USE_FEATURE_FANCY_ECHO("$ echo -e \"Erik\\nis\\ncool\"\n" \
734 "Erik\n" \
735 "is\n" \
736 "cool\n" \
737 "$ echo \"Erik\\nis\\ncool\"\n" \
738 "Erik\\nis\\ncool\n")
739
740#define eject_trivial_usage \
741 "[-t] [-T] [DEVICE]"
742#define eject_full_usage \
743 "Eject specified DEVICE (or default /dev/cdrom).\n\n" \
744 "Options:\n" \
745 " -t close tray\n" \
746 " -T open/close tray (toggle)"
747
748#define ed_trivial_usage ""
749#define ed_full_usage ""
750
751#define env_trivial_usage \
752 "[-iu] [-] [name=value]... [command]"
753#define env_full_usage \
754 "Prints the current environment or runs a program after setting\n" \
755 "up the specified environment.\n\n" \
756 "Options:\n" \
757 " -, -i start with an empty environment\n" \
758 " -u remove variable from the environment"
759
760#define ether_wake_trivial_usage \
761 "[-b] [-i iface] [-p aa:bb:cc:dd[:ee:ff]] MAC"
762#define ether_wake_full_usage \
763 "Send a magic packet to wake up sleeping machines.\n" \
764 "MAC must be a station address (00:11:22:33:44:55) or\n" \
765 " a hostname with a known 'ethers' entry.\n\n" \
766 "Options:\n" \
767 " -b Send wake-up packet to the broadcast address\n" \
768 " -i iface Use interface ifname instead of the default \"eth0\"\n" \
769 " -p pass Append the four or six byte password PW to the packet"
770
771#define expr_trivial_usage \
772 "EXPRESSION"
773#define expr_full_usage \
774 "Prints the value of EXPRESSION to standard output.\n\n" \
775 "EXPRESSION may be:\n" \
776 " ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2\n" \
777 " ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n" \
778 " ARG1 < ARG2 ARG1 is less than ARG2\n" \
779 " ARG1 <= ARG2 ARG1 is less than or equal to ARG2\n" \
780 " ARG1 = ARG2 ARG1 is equal to ARG2\n" \
781 " ARG1 != ARG2 ARG1 is unequal to ARG2\n" \
782 " ARG1 >= ARG2 ARG1 is greater than or equal to ARG2\n" \
783 " ARG1 > ARG2 ARG1 is greater than ARG2\n" \
784 " ARG1 + ARG2 arithmetic sum of ARG1 and ARG2\n" \
785 " ARG1 - ARG2 arithmetic difference of ARG1 and ARG2\n" \
786 " ARG1 * ARG2 arithmetic product of ARG1 and ARG2\n" \
787 " ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2\n" \
788 " ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2\n" \
789 " STRING : REGEXP anchored pattern match of REGEXP in STRING\n" \
790 " match STRING REGEXP same as STRING : REGEXP\n" \
791 " substr STRING POS LENGTH substring of STRING, POS counted from 1\n" \
792 " index STRING CHARS index in STRING where any CHARS is found,\n" \
793 " or 0\n" \
794 " length STRING length of STRING\n" \
795 " quote TOKEN interpret TOKEN as a string, even if\n" \
796 " it is a keyword like 'match' or an\n" \
797 " operator like '/'\n" \
798 " ( EXPRESSION ) value of EXPRESSION\n\n" \
799 "Beware that many operators need to be escaped or quoted for shells.\n" \
800 "Comparisons are arithmetic if both ARGs are numbers, else\n" \
801 "lexicographical. Pattern matches return the string matched between\n" \
802 "\\( and \\) or null; if \\( and \\) are not used, they return the number\n" \
803 "of characters matched or 0."
804
805#define fakeidentd_trivial_usage \
806 "[-b ip] [STRING]"
807#define fakeidentd_full_usage \
808 "Returns a set string to auth requests\n\n" \
809 " -b Bind to ip address\n" \
810 " STRING The ident answer string (default is nobody)"
811
812#define false_trivial_usage \
813 ""
814#define false_full_usage \
815 "Return an exit code of FALSE (1)."
816#define false_example_usage \
817 "$ false\n" \
818 "$ echo $?\n" \
819 "1\n"
820
821#define fbset_trivial_usage \
822 "[options] [mode]"
823#define fbset_full_usage \
824 "Show and modify frame buffer settings"
825#define fbset_example_usage \
826 "$ fbset\n" \
827 "mode \"1024x768-76\"\n" \
828 " # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz\n" \
829 " geometry 1024 768 1024 768 16\n" \
830 " timings 12714 128 32 16 4 128 4\n" \
831 " accel false\n" \
832 " rgba 5/11,6/5,5/0,0/0\n" \
833 "endmode\n"
834
835#define fdflush_trivial_usage \
836 "DEVICE"
837#define fdflush_full_usage \
838 "Forces floppy disk drive to detect disk change"
839
840#define fdformat_trivial_usage \
841 "[-n] DEVICE"
842#define fdformat_full_usage \
843 "Low-level formats a floppy disk\n\n" \
844 "Options:\n" \
845 " -n Don't verify after format"
846
847#define fdisk_trivial_usage \
848 "[-luv] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK"
849#define fdisk_full_usage \
850 "Change partition table\n" \
851 "Options:\n" \
852 " -l List partition table(s)\n" \
853 " -u Give Start and End in sector (instead of cylinder) units\n" \
854 " -s PARTITION Give partition size(s) in blocks\n" \
855 " -b 2048: (for certain MO disks) use 2048-byte sectors\n" \
856 " -C CYLINDERS Set the number of cylinders\n" \
857 " -H HEADS Set the number of heads\n" \
858 " -S SECTORS Set the number of sectors\n" \
859 " -v Give fdisk version"
860
861#define find_trivial_usage \
862 "[PATH...] [EXPRESSION]"
863#define find_full_usage \
864 "Search for files in a directory hierarchy. The default PATH is\n" \
865 "the current directory; default EXPRESSION is '-print'\n" \
866 "\nEXPRESSION may consist of:\n" \
867 " -follow Dereference symbolic links\n" \
868 " -name PATTERN File name (leading directories removed) matches PATTERN\n" \
869 " -print Print (default and assumed)" \
870 USE_FEATURE_FIND_PRINT0( \
871 "\n -print0 Delimit output with null characters rather than" \
872 "\n newlines" \
873 ) USE_FEATURE_FIND_TYPE( \
874 "\n -type X Filetype matches X (where X is one of: f,d,l,b,c,...)" \
875 ) USE_FEATURE_FIND_PERM( \
876 "\n -perm PERMS Permissions match any of (+NNN); all of (-NNN);" \
877 "\n or exactly (NNN)" \
878 ) USE_FEATURE_FIND_MTIME( \
879 "\n -mtime DAYS Modified time is greater than (+N); less than (-N);" \
880 "\n or exactly (N) days" \
881 ) USE_FEATURE_FIND_MMIN( \
882 "\n -mmin MINS Modified time is greater than (+N); less than (-N);" \
883 "\n or exactly (N) minutes" \
884 ) USE_FEATURE_FIND_NEWER( \
885 "\n -newer FILE Modified time is more recent than FILE's" \
886 ) USE_FEATURE_FIND_INUM( \
887 "\n -inum N File has inode number N" \
888 ) USE_FEATURE_FIND_EXEC( \
889 "\n -exec CMD Execute CMD with all instances of {} replaced by the" \
890 "\n files matching EXPRESSION" \
891 ) USE_DESKTOP( \
892 "\n -size N File size is N" \
893 "\n -prune Stop traversing current subtree" \
894 "\n (expr) Group" \
895 )
896
897#define find_example_usage \
898 "$ find / -name passwd\n" \
899 "/etc/passwd\n"
900
901#define fold_trivial_usage \
902 "[-bs] [-w WIDTH] [FILE]"
903#define fold_full_usage \
904 "Wrap input lines in each FILE (standard input by default), writing to\n" \
905 "standard output.\n\n" \
906 "Options:\n" \
907 " -b count bytes rather than columns\n" \
908 " -s break at spaces\n" \
909 " -w use WIDTH columns instead of 80"
910
911#define free_trivial_usage \
912 ""
913#define free_full_usage \
914 "Displays the amount of free and used system memory"
915#define free_example_usage \
916 "$ free\n" \
917 " total used free shared buffers\n" \
918 " Mem: 257628 248724 8904 59644 93124\n" \
919 " Swap: 128516 8404 120112\n" \
920 "Total: 386144 257128 129016\n" \
921
922#define freeramdisk_trivial_usage \
923 "DEVICE"
924#define freeramdisk_full_usage \
925 "Frees all memory used by the specified ramdisk."
926#define freeramdisk_example_usage \
927 "$ freeramdisk /dev/ram2\n"
928
929#define fsck_trivial_usage \
930 "[-ANPRTV] [ -C [ fd ] ] [-t fstype] [fs-options] [filesys ...]"
931#define fsck_full_usage \
932 "Check and repair filesystems.\n\n" \
933 "Options:\n" \
934 " -A Walk /etc/fstab and check all filesystems\n" \
935 " -N Don't execute, just show what would be done\n" \
936 " -P When using -A, check filesystems in parallel\n" \
937 " -R When using -A, skip the root filesystem\n" \
938 " -T Don't show title on startup\n" \
939 " -V Verbose mode\n" \
940 " -C Write status information to specified filedescriptor\n" \
941 " -t List of filesystem types to check"
942
943#define fsck_minix_trivial_usage \
944 "[-larvsmf] /dev/name"
945#define fsck_minix_full_usage \
946 "Performs a consistency check for MINIX filesystems.\n\n" \
947 "Options:\n" \
948 " -l Lists all filenames\n" \
949 " -r Perform interactive repairs\n" \
950 " -a Perform automatic repairs\n" \
951 " -v verbose\n" \
952 " -s Outputs super-block information\n" \
953 " -m Activates MINIX-like \"mode not cleared\" warnings\n" \
954 " -f Force file system check"
955
956#define ftpget_trivial_usage \
957 "[options] remote-host local-file remote-file"
958#define ftpget_full_usage \
959 "Retrieve a remote file via FTP.\n\n" \
960 "Options:\n" \
961 " -c, --continue Continue a previous transfer\n" \
962 " -v, --verbose Verbose\n" \
963 " -u, --username Username to be used\n" \
964 " -p, --password Password to be used\n" \
965 " -P, --port Port number to be used"
966
967#define ftpput_trivial_usage \
968 "[options] remote-host remote-file local-file"
969#define ftpput_full_usage \
970 "Store a local file on a remote machine via FTP.\n\n" \
971 "Options:\n" \
972 " -v, --verbose Verbose\n" \
973 " -u, --username Username to be used\n" \
974 " -p, --password Password to be used\n" \
975 " -P, --port Port number to be used"
976
977#define fuser_trivial_usage \
978 "[options] file OR port/proto"
979#define fuser_full_usage \
980 "Options:\n" \
981 " -m Show all processes on the same mounted fs\n" \
982 " -k Kill all processes that match.\n" \
983 " -s Don't print or kill anything.\n" \
984 " -4 When using port/proto only search IPv4 space\n" \
985 " -6 When using port/proto only search IPv6 space\n" \
986 " -SIGNAL When used with -k, this signal will be used to kill"
987
988#define getopt_trivial_usage \
989 "[OPTIONS]..."
990#define getopt_full_usage \
991 "Parse command options\n" \
992 " -a, --alternative Allow long options starting with single -\n" \
993 " -l, --longoptions=longopts Long options to be recognized\n" \
994 " -n, --name=progname The name under which errors are reported\n" \
995 " -o, --options=optstring Short options to be recognized\n" \
996 " -q, --quiet Disable error reporting by getopt(3)\n" \
997 " -Q, --quiet-output No normal output\n" \
998 " -s, --shell=shell Set shell quoting conventions\n" \
999 " -T, --test Test for getopt(1) version\n" \
1000 " -u, --unquoted Do not quote the output"
1001#define getopt_example_usage \
1002 "$ cat getopt.test\n" \
1003 "#!/bin/sh\n" \
1004 "GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \\\n" \
1005 " -n 'example.busybox' -- \"$@\"`\n" \
1006 "if [ $? != 0 ] ; then exit 1 ; fi\n" \
1007 "eval set -- \"$GETOPT\"\n" \
1008 "while true ; do\n" \
1009 " case $1 in\n" \
1010 " -a|--a-long) echo \"Option a\" ; shift ;;\n" \
1011 " -b|--b-long) echo \"Option b, argument '$2'\" ; shift 2 ;;\n" \
1012 " -c|--c-long)\n" \
1013 " case \"$2\" in\n" \
1014 " \"\") echo \"Option c, no argument\"; shift 2 ;;\n" \
1015 " *) echo \"Option c, argument '$2'\" ; shift 2 ;;\n" \
1016 " esac ;;\n" \
1017 " --) shift ; break ;;\n" \
1018 " *) echo \"Internal error!\" ; exit 1 ;;\n" \
1019 " esac\n" \
1020 "done\n"
1021
1022#define getty_trivial_usage \
1023 "[OPTIONS]... baud_rate,... line [termtype]"
1024#define getty_full_usage \
1025 "Opens a tty, prompts for a login name, then invokes /bin/login\n\n" \
1026 "Options:\n" \
1027 " -h Enable hardware (RTS/CTS) flow control\n" \
1028 " -i Do not display /etc/issue before running login\n" \
1029 " -L Local line, so do not do carrier detect\n" \
1030 " -m Get baud rate from modem's CONNECT status message\n" \
1031 " -w Wait for a CR or LF before sending /etc/issue\n" \
1032 " -n Do not prompt the user for a login name\n" \
1033 " -f issue_file Display issue_file instead of /etc/issue\n" \
1034 " -l login_app Invoke login_app instead of /bin/login\n" \
1035 " -t timeout Terminate after timeout if no username is read\n" \
1036 " -I initstring Sets the init string to send before anything else\n" \
1037 " -H login_host Log login_host into the utmp file as the hostname"
1038
1039#define grep_trivial_usage \
1040 "[-rihHnqvso" \
1041 USE_FEATURE_GREP_EGREP_ALIAS("E") \
1042 USE_FEATURE_GREP_CONTEXT("ABC") \
1043 "] PATTERN [FILEs...]"
1044#define grep_full_usage \
1045 "Search for PATTERN in each FILE or standard input.\n\n" \
1046 "Options:\n" \
1047 " -H prefix output lines with filename where match was found\n" \
1048 " -h suppress the prefixing filename on output\n" \
1049 " -r recurse subdirectories\n" \
1050 " -i ignore case distinctions\n" \
1051 " -l list names of files that match\n" \
1052 " -L list names of files that do not match\n" \
1053 " -n print line number with output lines\n" \
1054 " -q be quiet. Returns 0 if PATTERN was found, 1 otherwise\n" \
1055 " -v select non-matching lines\n" \
1056 " -s suppress file open/read error messages\n" \
1057 " -c only print count of matching lines\n" \
1058 " -f read PATTERN from file\n" \
1059 " -o show only the part of a line that matches PATTERN\n" \
1060 " -e PATTERN is a regular expression\n" \
1061 " -F PATTERN is a set of newline-separated strings" \
1062 USE_FEATURE_GREP_EGREP_ALIAS("\n -E PATTERN is an extended regular expression") \
1063 USE_FEATURE_GREP_CONTEXT("\n -A print NUM lines of trailing context") \
1064 USE_FEATURE_GREP_CONTEXT("\n -B print NUM lines of leading context") \
1065 USE_FEATURE_GREP_CONTEXT("\n -C print NUM lines of output context")
1066
1067#define grep_example_usage \
1068 "$ grep root /etc/passwd\n" \
1069 "root:x:0:0:root:/root:/bin/bash\n" \
1070 "$ grep ^[rR]oo. /etc/passwd\n" \
1071 "root:x:0:0:root:/root:/bin/bash\n"
1072
1073#define gunzip_trivial_usage \
1074 "[OPTION]... FILE"
1075#define gunzip_full_usage \
1076 "Uncompress FILE (or standard input if FILE is '-').\n\n" \
1077 "Options:\n" \
1078 " -c Write output to standard output\n" \
1079 " -f Force read when source is a terminal\n" \
1080 " -t Test compressed file integrity"
1081#define gunzip_example_usage \
1082 "$ ls -la /tmp/BusyBox*\n" \
1083 "-rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz\n" \
1084 "$ gunzip /tmp/BusyBox-0.43.tar.gz\n" \
1085 "$ ls -la /tmp/BusyBox*\n" \
1086 "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar\n"
1087
1088#define gzip_trivial_usage \
1089 "[OPTION]... [FILE]..."
1090#define gzip_full_usage \
1091 "Compress FILE(s) with maximum compression.\n" \
1092 "When FILE is '-' or unspecified, reads standard input. Implies -c.\n\n" \
1093 "Options:\n" \
1094 " -c Write output to standard output instead of FILE.gz\n" \
1095 " -d Decompress\n" \
1096 " -f Force write when destination is a terminal"
1097#define gzip_example_usage \
1098 "$ ls -la /tmp/busybox*\n" \
1099 "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar\n" \
1100 "$ gzip /tmp/busybox.tar\n" \
1101 "$ ls -la /tmp/busybox*\n" \
1102 "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
1103
1104#define halt_trivial_usage \
1105 "[-d<delay>] [-n<nosync>] [-f<force>]"
1106#define halt_full_usage \
1107 "Halt the system.\n" \
1108 "Options:\n" \
1109 " -d delay interval for halting\n" \
1110 " -n no call to sync()\n" \
1111 " -f force halt (don't go through init)"
1112
1113#define hdparm_trivial_usage \
1114 "[options] [device] .."
1115#define hdparm_full_usage \
1116 USE_FEATURE_HDPARM_GET_IDENTITY(" If no device name is specified try to read from stdin.\n") \
1117 "\nOptions:\n" \
1118 " -a get/set fs readahead\n" \
1119 " -A set drive read-lookahead flag (0/1)\n" \
1120 " -b get/set bus state (0 == off, 1 == on, 2 == tristate)\n" \
1121 " -B set Advanced Power Management setting (1-255)\n" \
1122 " -c get/set IDE 32-bit IO setting\n" \
1123 " -C check IDE power mode status\n" \
1124 USE_FEATURE_HDPARM_HDIO_GETSET_DMA(" -d get/set using_dma flag\n") \
1125 " -D enable/disable drive defect-mgmt\n" \
1126 " -f flush buffer cache for device on exit\n" \
1127 " -g display drive geometry\n" \
1128 " -h display terse usage information\n" \
1129 USE_FEATURE_HDPARM_GET_IDENTITY(" -i display drive identification\n") \
1130 USE_FEATURE_HDPARM_GET_IDENTITY(" -I detailed/current information directly from drive\n") \
1131 " -k get/set keep_settings_over_reset flag (0/1)\n" \
1132 " -K set drive keep_features_over_reset flag (0/1)\n" \
1133 " -L set drive doorlock (0/1) (removable harddisks only)\n" \
1134 " -m get/set multiple sector count\n" \
1135 " -n get/set ignore-write-errors flag (0/1)\n" \
1136 " -p set PIO mode on IDE interface chipset (0,1,2,3,4,...)\n" \
1137 " -P set drive prefetch count\n" \
1138 " -q change next setting quietly\n" \
1139 " -Q get/set DMA tagged-queuing depth (if supported)\n" \
1140 " -r get/set readonly flag (DANGEROUS to set)\n" \
1141 USE_FEATURE_HDPARM_HDIO_SCAN_HWIF(" -R register an IDE interface (DANGEROUS)\n") \
1142 " -S set standby (spindown) timeout\n" \
1143 " -t perform device read timings\n" \
1144 " -T perform cache read timings\n" \
1145 " -u get/set unmaskirq flag (0/1)\n" \
1146 USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(" -U un-register an IDE interface (DANGEROUS)\n") \
1147 " -v defaults; same as -mcudkrag for IDE drives\n" \
1148 " -V display program version and exit immediately\n" \
1149 USE_FEATURE_HDPARM_HDIO_DRIVE_RESET(" -w perform device reset (DANGEROUS)\n") \
1150 " -W set drive write-caching flag (0/1) (DANGEROUS)\n" \
1151 USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(" -x tristate device for hotswap (0/1) (DANGEROUS)\n") \
1152 " -X set IDE xfer mode (DANGEROUS)\n" \
1153 " -y put IDE drive in standby mode\n" \
1154 " -Y put IDE drive to sleep\n" \
1155 " -Z disable Seagate auto-powersaving mode\n" \
1156 " -z re-read partition table"
1157
1158#define head_trivial_usage \
1159 "[OPTION]... [FILE]..."
1160#define head_full_usage \
1161 "Print first 10 lines of each FILE to standard output.\n" \
1162 "With more than one FILE, precede each with a header giving the\n" \
1163 "file name. With no FILE, or when FILE is -, read standard input.\n\n" \
1164 "Options:\n" \
1165 " -n NUM Print first NUM lines instead of first 10" \
1166 USE_FEATURE_FANCY_HEAD( \
1167 "\n -c NUM output the first NUM bytes\n" \
1168 " -q never output headers giving file names\n" \
1169 " -v always output headers giving file names" )
1170#define head_example_usage \
1171 "$ head -n 2 /etc/passwd\n" \
1172 "root:x:0:0:root:/root:/bin/bash\n" \
1173 "daemon:x:1:1:daemon:/usr/sbin:/bin/sh\n"
1174
1175#define hexdump_trivial_usage \
1176 "[-[bcCdefnosvx]] [OPTION] FILE"
1177#define hexdump_full_usage \
1178 "The hexdump utility is a filter which displays the specified files,\n" \
1179 "or the standard input, if no files are specified, in a user specified\n" \
1180 "format\n" \
1181 " -b One-byte octal display\n" \
1182 " -c One-byte character display\n" \
1183 " -C Canonical hex+ASCII, 16 bytes per line\n" \
1184 " -d Two-byte decimal display\n" \
1185 " -e FORMAT STRING\n" \
1186 " -f FORMAT FILE\n" \
1187 " -n LENGTH Interpret only length bytes of input\n" \
1188 " -o Two-byte octal display\n" \
1189 " -s OFFSET Skip offset byte\n" \
1190 " -v display all input data\n" \
1191 " -x Two-byte hexadecimal display"
1192
1193#define hostid_trivial_usage \
1194 ""
1195#define hostid_full_usage \
1196 "Print out a unique 32-bit identifier for the machine."
1197
1198#define hostname_trivial_usage \
1199 "[OPTION] {hostname | -F FILE}"
1200#define hostname_full_usage \
1201 "Get or set the hostname or DNS domain name. If a hostname is given\n" \
1202 "(or FILE with the -F parameter), the host name will be set.\n\n" \
1203 "Options:\n" \
1204 " -s Short\n" \
1205 " -i Addresses for the hostname\n" \
1206 " -d DNS domain name\n" \
1207 " -f Fully qualified domain name\n" \
1208 " -F FILE Use the contents of FILE to specify the hostname"
1209#define hostname_example_usage \
1210 "$ hostname\n" \
1211 "sage\n"
1212
1213#define httpd_trivial_usage \
1214 "[-c <conf file>]" \
1215 " [-p <port>]" \
1216 " [-i] [-f]" \
1217 USE_FEATURE_HTTPD_SETUID(" [-u user[:grp]]") \
1218 USE_FEATURE_HTTPD_BASIC_AUTH(" [-r <realm>]") \
1219 USE_FEATURE_HTTPD_AUTH_MD5(" [-m pass]") \
1220 " [-h home]" \
1221 " [-d/-e <string>]"
1222#define httpd_full_usage \
1223 "Listens for incoming http server requests.\n\n" \
1224 "Options:\n" \
1225 " -c FILE Specifies configuration file. (default httpd.conf)\n" \
1226 " -p PORT Server port (default 80)\n" \
1227 " -i Assume that we are started from inetd\n" \
1228 " -f Do not daemonize\n" \
1229 USE_FEATURE_HTTPD_SETUID(" -u USER[:GRP] Set uid/gid after binding to port\n") \
1230 USE_FEATURE_HTTPD_BASIC_AUTH(" -r REALM Authentication Realm for Basic Authentication\n") \
1231 USE_FEATURE_HTTPD_AUTH_MD5(" -m PASS Crypt PASS with md5 algorithm\n") \
1232 " -h HOME Specifies http HOME directory (default ./)\n" \
1233 " -e STRING HTML encode STRING\n" \
1234 " -d STRING URL decode STRING"
1235
1236#define hwclock_trivial_usage \
1237 "[-r|--show] [-s|--hctosys] [-w|--systohc] [-l|--localtime] [-u|--utc]"
1238#define hwclock_full_usage \
1239 "Query and set the hardware clock (RTC)\n\n" \
1240 "Options:\n" \
1241 " -r read hardware clock and print result\n" \
1242 " -s set the system time from the hardware clock\n" \
1243 " -w set the hardware clock to the current system time\n" \
1244 " -u the hardware clock is kept in coordinated universal time\n" \
1245 " -l the hardware clock is kept in local time"
1246
1247#define id_trivial_usage \
1248 "[OPTIONS]... [USERNAME]"
1249#define id_full_usage \
1250 "Print information for USERNAME or the current user\n\n" \
1251 "Options:\n" \
1252 USE_SELINUX(" -c prints only the security context\n") \
1253 " -g prints only the group ID\n" \
1254 " -u prints only the user ID\n" \
1255 " -n print a name instead of a number\n" \
1256 " -r prints the real user ID instead of the effective ID"
1257#define id_example_usage \
1258 "$ id\n" \
1259 "uid=1000(andersen) gid=1000(andersen)\n"
1260
1261#define ifconfig_trivial_usage \
1262 USE_FEATURE_IFCONFIG_STATUS("[-a]") " <interface> [<address>]"
1263#define ifconfig_full_usage \
1264 "configure a network interface\n\n" \
1265 "Options:\n" \
1266 USE_FEATURE_IPV6(" [add <address>[/<prefixlen>]]\n") \
1267 USE_FEATURE_IPV6(" [del <address>[/<prefixlen>]]\n") \
1268 " [[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n" \
1269 " [netmask <address>] [dstaddr <address>]\n" \
1270 USE_FEATURE_IFCONFIG_SLIP(" [outfill <NN>] [keepalive <NN>]\n") \
1271 " " USE_FEATURE_IFCONFIG_HW("[hw ether <address>] ") \
1272 "[metric <NN>] [mtu <NN>]\n" \
1273 " [[-]trailers] [[-]arp] [[-]allmulti]\n" \
1274 " [multicast] [[-]promisc] [txqueuelen <NN>] [[-]dynamic]\n" \
1275 USE_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ(" [mem_start <NN>] [io_addr <NN>] [irq <NN>]\n") \
1276 " [up|down] ..."
1277
1278#define ifup_trivial_usage \
1279 "<-ahinv> <ifaces...>"
1280#define ifup_full_usage \
1281 "ifup <options> <ifaces...>\n\n" \
1282 "Options:\n" \
1283 " -h this help\n" \
1284 " -a de/configure all interfaces automatically\n" \
1285 " -i FILE use FILE for interface definitions\n" \
1286 " -n print out what would happen, but don't do it\n" \
1287 " (note that this option doesn't disable mappings)\n" \
1288 " -v print out what would happen before doing it\n" \
1289 " -m don't run any mappings\n" \
1290 " -f force de/configuration"
1291
1292#define ifdown_trivial_usage \
1293 "<-ahinv> <ifaces...>"
1294#define ifdown_full_usage \
1295 "ifdown <options> <ifaces...>\n\n" \
1296 "Options:\n" \
1297 " -h this help\n" \
1298 " -a de/configure all interfaces automatically\n" \
1299 " -i FILE use FILE for interface definitions\n" \
1300 " -n print out what would happen, but don't do it\n" \
1301 " (note that this option doesn't disable mappings)\n" \
1302 " -v print out what would happen before doing it\n" \
1303 " -m don't run any mappings\n" \
1304 " -f force de/configuration"
1305
1306#define inetd_trivial_usage \
1307 "[-f] [-q len] [conf]"
1308#define inetd_full_usage \
1309 "Listens for network connections and launches programs\n\n" \
1310 "Option:\n" \
1311 " -f Run as a foreground progress\n" \
1312 " -q Sets the size of the socket listen queue to\n" \
1313 " the specified value. Default is 128"
1314
1315#define init_trivial_usage \
1316 ""
1317#define init_full_usage \
1318 "Init is the parent of all processes."
1319#define init_notes_usage \
1320"This version of init is designed to be run only by the kernel.\n" \
1321"\n" \
1322"BusyBox init doesn't support multiple runlevels. The runlevels field of\n" \
1323"the /etc/inittab file is completely ignored by BusyBox init. If you want\n" \
1324"runlevels, use sysvinit.\n" \
1325"\n" \
1326"BusyBox init works just fine without an inittab. If no inittab is found,\n" \
1327"it has the following default behavior:\n" \
1328"\n" \
1329" ::sysinit:/etc/init.d/rcS\n" \
1330" ::askfirst:/bin/sh\n" \
1331" ::ctrlaltdel:/sbin/reboot\n" \
1332" ::shutdown:/sbin/swapoff -a\n" \
1333" ::shutdown:/bin/umount -a -r\n" \
1334" ::restart:/sbin/init\n" \
1335"\n" \
1336"if it detects that /dev/console is _not_ a serial console, it will also run:\n" \
1337"\n" \
1338" tty2::askfirst:/bin/sh\n" \
1339" tty3::askfirst:/bin/sh\n" \
1340" tty4::askfirst:/bin/sh\n" \
1341"\n" \
1342"If you choose to use an /etc/inittab file, the inittab entry format is as follows:\n" \
1343"\n" \
1344" <id>:<runlevels>:<action>:<process>\n" \
1345"\n" \
1346" <id>:\n" \
1347"\n" \
1348" WARNING: This field has a non-traditional meaning for BusyBox init!\n" \
1349" The id field is used by BusyBox init to specify the controlling tty for\n" \
1350" the specified process to run on. The contents of this field are\n" \
1351" appended to \"/dev/\" and used as-is. There is no need for this field to\n" \
1352" be unique, although if it isn't you may have strange results. If this\n" \
1353" field is left blank, the controlling tty is set to the console. Also\n" \
1354" note that if BusyBox detects that a serial console is in use, then only\n" \
1355" entries whose controlling tty is either the serial console or /dev/null\n" \
1356" will be run. BusyBox init does nothing with utmp. We don't need no\n" \
1357" stinkin' utmp.\n" \
1358"\n" \
1359" <runlevels>:\n" \
1360"\n" \
1361" The runlevels field is completely ignored.\n" \
1362"\n" \
1363" <action>:\n" \
1364"\n" \
1365" Valid actions include: sysinit, respawn, askfirst, wait,\n" \
1366" once, restart, ctrlaltdel, and shutdown.\n" \
1367"\n" \
1368" The available actions can be classified into two groups: actions\n" \
1369" that are run only once, and actions that are re-run when the specified\n" \
1370" process exits.\n" \
1371"\n" \
1372" Run only-once actions:\n" \
1373"\n" \
1374" 'sysinit' is the first item run on boot. init waits until all\n" \
1375" sysinit actions are completed before continuing. Following the\n" \
1376" completion of all sysinit actions, all 'wait' actions are run.\n" \
1377" 'wait' actions, like 'sysinit' actions, cause init to wait until\n" \
1378" the specified task completes. 'once' actions are asynchronous,\n" \
1379" therefore, init does not wait for them to complete. 'restart' is\n" \
1380" the action taken to restart the init process. By default this should\n" \
1381" simply run /sbin/init, but can be a script which runs pivot_root or it\n" \
1382" can do all sorts of other interesting things. The 'ctrlaltdel' init\n" \
1383" actions are run when the system detects that someone on the system\n" \
1384" console has pressed the CTRL-ALT-DEL key combination. Typically one\n" \
1385" wants to run 'reboot' at this point to cause the system to reboot.\n" \
1386" Finally the 'shutdown' action specifies the actions to taken when\n" \
1387" init is told to reboot. Unmounting filesystems and disabling swap\n" \
1388" is a very good here\n" \
1389"\n" \
1390" Run repeatedly actions:\n" \
1391"\n" \
1392" 'respawn' actions are run after the 'once' actions. When a process\n" \
1393" started with a 'respawn' action exits, init automatically restarts\n" \
1394" it. Unlike sysvinit, BusyBox init does not stop processes from\n" \
1395" respawning out of control. The 'askfirst' actions acts just like\n" \
1396" respawn, except that before running the specified process it\n" \
1397" displays the line \"Please press Enter to activate this console.\"\n" \
1398" and then waits for the user to press enter before starting the\n" \
1399" specified process.\n" \
1400"\n" \
1401" Unrecognized actions (like initdefault) will cause init to emit an\n" \
1402" error message, and then go along with its business. All actions are\n" \
1403" run in the order they appear in /etc/inittab.\n" \
1404"\n" \
1405" <process>:\n" \
1406"\n" \
1407" Specifies the process to be executed and its command line.\n" \
1408"\n" \
1409"Example /etc/inittab file:\n" \
1410"\n" \
1411" # This is run first except when booting in single-user mode.\n" \
1412" #\n" \
1413" ::sysinit:/etc/init.d/rcS\n" \
1414" \n" \
1415" # /bin/sh invocations on selected ttys\n" \
1416" #\n" \
1417" # Start an \"askfirst\" shell on the console (whatever that may be)\n" \
1418" ::askfirst:-/bin/sh\n" \
1419" # Start an \"askfirst\" shell on /dev/tty2-4\n" \
1420" tty2::askfirst:-/bin/sh\n" \
1421" tty3::askfirst:-/bin/sh\n" \
1422" tty4::askfirst:-/bin/sh\n" \
1423" \n" \
1424" # /sbin/getty invocations for selected ttys\n" \
1425" #\n" \
1426" tty4::respawn:/sbin/getty 38400 tty4\n" \
1427" tty5::respawn:/sbin/getty 38400 tty5\n" \
1428" \n" \
1429" \n" \
1430" # Example of how to put a getty on a serial line (for a terminal)\n" \
1431" #\n" \
1432" #::respawn:/sbin/getty -L ttyS0 9600 vt100\n" \
1433" #::respawn:/sbin/getty -L ttyS1 9600 vt100\n" \
1434" #\n" \
1435" # Example how to put a getty on a modem line.\n" \
1436" #::respawn:/sbin/getty 57600 ttyS2\n" \
1437" \n" \
1438" # Stuff to do when restarting the init process\n" \
1439" ::restart:/sbin/init\n" \
1440" \n" \
1441" # Stuff to do before rebooting\n" \
1442" ::ctrlaltdel:/sbin/reboot\n" \
1443" ::shutdown:/bin/umount -a -r\n" \
1444" ::shutdown:/sbin/swapoff -a\n"
1445
1446#define insmod_trivial_usage \
1447 "[OPTION]... MODULE [symbol=value]..."
1448#define insmod_full_usage \
1449 "Loads the specified kernel modules into the kernel.\n\n" \
1450 "Options:\n" \
1451 " -f Force module to load into the wrong kernel version\n" \
1452 " -k Make module autoclean-able\n" \
1453 " -v verbose output\n" \
1454 " -q quiet output\n" \
1455 " -L Lock to prevent simultaneous loads of a module\n" \
1456 USE_FEATURE_INSMOD_LOAD_MAP(" -m Output load map to stdout\n") \
1457 " -o NAME Set internal module name to NAME\n" \
1458 " -x do not export externs"
1459
1460#define install_trivial_usage \
1461 "[-cgmops] [sources] <dest|directory>"
1462#define install_full_usage \
1463 "Copies files and set attributes\n\n" \
1464 "Options:\n" \
1465 " -c copy the file, default\n" \
1466 " -d create directories\n" \
1467 " -g set group ownership\n" \
1468 " -m set permission modes\n" \
1469 " -o set ownership\n" \
1470 " -p preserve date\n" \
1471 " -s strip symbol tables"
1472
1473#define ip_trivial_usage \
1474 "[OPTIONS] {address | link | route | tunnel | rule} {COMMAND}"
1475#define ip_full_usage \
1476 "ip [OPTIONS] OBJECT {COMMAND}\n" \
1477 "where OBJECT := {link | addr | route | tunnel |rule}\n" \
1478 "OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }"
1479
1480#define ipaddr_trivial_usage \
1481 "{ {add|del} IFADDR dev STRING | {show|flush}\n" \
1482 " [ dev STRING ] [ to PREFIX ] }"
1483#define ipaddr_full_usage \
1484 "ipaddr {add|delete} IFADDR dev STRING\n" \
1485 "ipaddr {show|flush} [ dev STRING ] [ scope SCOPE-ID ]\n" \
1486 " [ to PREFIX ] [ label PATTERN ]\n" \
1487 " IFADDR := PREFIX | ADDR peer PREFIX\n" \
1488 " [ broadcast ADDR ] [ anycast ADDR ]\n" \
1489 " [ label STRING ] [ scope SCOPE-ID ]\n" \
1490 " SCOPE-ID := [ host | link | global | NUMBER ]"
1491
1492#define ipcalc_trivial_usage \
1493 "[OPTION]... <ADDRESS>[[/]<NETMASK>] [NETMASK]"
1494#define ipcalc_full_usage \
1495 "Calculate IP network settings from a IP address\n\n" \
1496 "Options:\n" \
1497 " -b --broadcast Display calculated broadcast address\n" \
1498 " -n --network Display calculated network address\n" \
1499 " -m --netmask Display default netmask for IP" \
1500 USE_FEATURE_IPCALC_FANCY( \
1501 "\n -p --prefix Display the prefix for IP/NETMASK\n" \
1502 " -h --hostname Display first resolved host name\n" \
1503 " -s --silent Don't ever display error messages")
1504
1505#define ipcrm_trivial_usage \
1506 "[-[MQS] key] [-[mqs] id]"
1507#define ipcrm_full_usage \
1508 "The upper-case options MQS are used to remove a shared memory segment by a\n" \
1509 "segment by a shmkey value. The lower-case options mqs are used\n" \
1510 "to remove a segment by shmid value.\n" \
1511 " -[mM] Remove the memory segment after the last detach\n" \
1512 " -[qQ] Remove the message queue\n" \
1513 " -[sS] Remove the semaphore"
1514
1515#define ipcs_trivial_usage \
1516 "[[-smq] -i shmid] | [[-asmq] [-tcplu]]"
1517#define ipcs_full_usage \
1518 " -i specify a specific resource id\n" \
1519 "Resource specification:\n" \
1520 " -m shared memory segments\n" \
1521 " -q message queues\n" \
1522 " -s semaphore arrays\n" \
1523 " -a all (default)\n" \
1524 "Output format:\n" \
1525 " -t time\n" \
1526 " -c creator\n" \
1527 " -p pid\n" \
1528 " -l limits\n" \
1529 " -u summary"
1530
1531#define iplink_trivial_usage \
1532 "{ set DEVICE { up | down | arp { on | off } | show [ DEVICE ] }"
1533#define iplink_full_usage \
1534 "iplink set DEVICE { up | down | arp { on | off } |\n" \
1535 " dynamic { on | off } |\n" \
1536 " mtu MTU }\n" \
1537 " iplink show [ DEVICE ]"
1538
1539#define iproute_trivial_usage \
1540 "{ list | flush | { add | del | change | append |\n" \
1541 " replace | monitor } ROUTE }"
1542#define iproute_full_usage \
1543 "iproute { list | flush } SELECTOR\n" \
1544 "iproute get ADDRESS [ from ADDRESS iif STRING ]\n" \
1545 " [ oif STRING ] [ tos TOS ]\n" \
1546 " iproute { add | del | change | append | replace | monitor } ROUTE\n" \
1547 " SELECTOR := [ root PREFIX ] [ match PREFIX ] [ proto RTPROTO ]\n" \
1548 " ROUTE := [ TYPE ] PREFIX [ tos TOS ] [ proto RTPROTO ]"
1549
1550#define iprule_trivial_usage \
1551 "{[ list | add | del ] RULE}"
1552#define iprule_full_usage \
1553 "iprule [ list | add | del ] SELECTOR ACTION\n" \
1554 " SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK ]\n" \
1555 " [ dev STRING ] [ pref NUMBER ]\n" \
1556 " ACTION := [ table TABLE_ID ] [ nat ADDRESS ]\n" \
1557 " [ prohibit | reject | unreachable ]\n" \
1558 " [ realms [SRCREALM/]DSTREALM ]\n" \
1559 " TABLE_ID := [ local | main | default | NUMBER ]"
1560
1561#define iptunnel_trivial_usage \
1562 "{ add | change | del | show } [ NAME ]\n" \
1563 " [ mode { ipip | gre | sit } ]\n" \
1564 " [ remote ADDR ] [ local ADDR ] [ ttl TTL ]"
1565#define iptunnel_full_usage \
1566 "iptunnel { add | change | del | show } [ NAME ]\n" \
1567 " [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]\n" \
1568 " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" \
1569 " [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]"
1570
1571#define kill_trivial_usage \
1572 "[-l] [-signal] process-id [process-id ...]"
1573#define kill_full_usage \
1574 "Send a signal (default is TERM) to the specified process(es).\n\n" \
1575 "Options:\n" \
1576 " -l List all signal names and numbers"
1577#define kill_example_usage \
1578 "$ ps | grep apache\n" \
1579 "252 root root S [apache]\n" \
1580 "263 www-data www-data S [apache]\n" \
1581 "264 www-data www-data S [apache]\n" \
1582 "265 www-data www-data S [apache]\n" \
1583 "266 www-data www-data S [apache]\n" \
1584 "267 www-data www-data S [apache]\n" \
1585 "$ kill 252\n"
1586
1587#define killall_trivial_usage \
1588 "[-l] [-q] [-signal] process-name [process-name ...]"
1589#define killall_full_usage \
1590 "Send a signal (default is TERM) to the specified process(es).\n\n" \
1591 "Options:\n" \
1592 " -l List all signal names and numbers\n" \
1593 " -q Do not complain if no processes were killed"
1594#define killall_example_usage \
1595 "$ killall apache\n"
1596
1597#define killall5_trivial_usage \
1598 "[-l] [-signal]"
1599#define killall5_full_usage \
1600 "Send a signal (default is TERM) to all processes outside current session.\n\n" \
1601 "Options:\n" \
1602 " -l List all signal names and numbers\n" \
1603
1604#define klogd_trivial_usage \
1605 "[-c n] [-n]"
1606#define klogd_full_usage \
1607 "Kernel logger.\n" \
1608 "Options:\n" \
1609 " -c n Sets the default log level of console messages to n\n" \
1610 " -n Run as a foreground process"
1611
1612#define length_trivial_usage \
1613 "STRING"
1614#define length_full_usage \
1615 "Prints out the length of the specified STRING."
1616#define length_example_usage \
1617 "$ length Hello\n" \
1618 "5\n"
1619
1620#define less_trivial_usage \
1621 "[-EMNmh~?] FILE1 FILE2..."
1622#define less_full_usage \
1623 "View a file or list of files. The position within files can be\n" \
1624 "changed, and files can be manipulated in various ways with the\n" \
1625 "following options:\n\n" \
1626 " -E Quit once the end of a file is reached\n" \
1627 " -M Display a status line containing the current line numbers\n" \
1628 " and the percentage through the file\n" \
1629 " -N Prefix line numbers to each line\n" \
1630 " -m Display a status line containing the percentage through the\n" \
1631 " file\n" \
1632 " -~ Suppress ~s displayed when input past the end of the file is\n" \
1633 " reached.\n" \
1634 " -h, -? Display this help message"
1635
1636#define setarch_trivial_usage \
1637 "<personality> <program> [args ...]"
1638#define setarch_full_usage \
1639 "Personality may be:\n" \
1640 " linux32 Set 32bit uname emulation\n" \
1641 " linux64 Set 64bit uname emulation"
1642
1643#define ln_trivial_usage \
1644 "[OPTION] TARGET... LINK_NAME|DIRECTORY"
1645#define ln_full_usage \
1646 "Create a link named LINK_NAME or DIRECTORY to the specified TARGET\n" \
1647 "\nYou may use '--' to indicate that all following arguments are non-options.\n\n" \
1648 "Options:\n" \
1649 " -s make symbolic links instead of hard links\n" \
1650 " -f remove existing destination files\n" \
1651 " -n no dereference symlinks - treat like normal file\n" \
1652 " -b make a backup of the target (if exists) before link operation\n" \
1653 " -S suffix use suffix instead of ~ when making backup files"
1654#define ln_example_usage \
1655 "$ ln -s BusyBox /tmp/ls\n" \
1656 "$ ls -l /tmp/ls\n" \
1657 "lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*\n"
1658
1659#define loadfont_trivial_usage \
1660 "< font"
1661#define loadfont_full_usage \
1662 "Loads a console font from standard input."
1663#define loadfont_example_usage \
1664 "$ loadfont < /etc/i18n/fontname\n"
1665
1666#define loadkmap_trivial_usage \
1667 "< keymap"
1668#define loadkmap_full_usage \
1669 "Loads a binary keyboard translation table from standard input."
1670#define loadkmap_example_usage \
1671 "$ loadkmap < /etc/i18n/lang-keymap\n"
1672
1673#define logger_trivial_usage \
1674 "[OPTION]... [MESSAGE]"
1675#define logger_full_usage \
1676 "Write MESSAGE to the system log. If MESSAGE is omitted, log stdin.\n\n" \
1677 "Options:\n" \
1678 " -s Log to stderr as well as the system log\n" \
1679 " -t TAG Log using the specified tag (defaults to user name)\n" \
1680 " -p PRIORITY Enter the message with the specified priority\n" \
1681 " This may be numerical or a 'facility.level' pair"
1682#define logger_example_usage \
1683 "$ logger \"hello\"\n"
1684
1685#define login_trivial_usage \
1686 "[OPTION]... [username] [ENV=VAR ...]"
1687#define login_full_usage \
1688 "Begin a new session on the system\n\n" \
1689 "Options:\n" \
1690 " -f Do not authenticate (user already authenticated)\n" \
1691 " -h Name of the remote host for this login\n" \
1692 " -p Preserve environment"
1693
1694#define logname_trivial_usage \
1695 ""
1696#define logname_full_usage \
1697 "Print the name of the current user."
1698#define logname_example_usage \
1699 "$ logname\n" \
1700 "root\n"
1701
1702#define logread_trivial_usage \
1703 "[OPTION]..."
1704#define logread_full_usage \
1705 "Shows the messages from syslogd (using circular buffer).\n\n" \
1706 "Options:\n" \
1707 " -f output data as the log grows"
1708
1709#define losetup_trivial_usage \
1710 "[-o OFFSET] [-d] LOOPDEVICE [FILE]]"
1711#define losetup_full_usage \
1712 "(Dis)associate LOOPDEVICE with FILE, or display current associations.\n\n" \
1713 "Options:\n" \
1714 " -d Disassociate LOOPDEVICE\n" \
1715 " -o OFFSET Start OFFSET bytes into FILE"
1716#define losetup_notes_usage \
1717 "No arguments will display all current associations.\n" \
1718 "One argument (losetup /dev/loop1) will display the current association\n" \
1719 "(if any), or disassociate it (with -d). The display shows the offset\n" \
1720 "and filename of the file the loop device is currently bound to.\n\n" \
1721 "Two arguments (losetup /dev/loop1 file.img) create a new association,\n" \
1722 "with an optional offset (-o 12345). Encryption is not yet supported.\n\n"
1723
1724#define ls_trivial_usage \
1725 "[-1Aa" USE_FEATURE_LS_TIMESTAMPS("c") "Cd" \
1726 USE_FEATURE_LS_TIMESTAMPS("e") USE_FEATURE_LS_FILETYPES("F") "iln" \
1727 USE_FEATURE_LS_FILETYPES("p") USE_FEATURE_LS_FOLLOWLINKS("L") \
1728 USE_FEATURE_LS_RECURSIVE("R") USE_FEATURE_LS_SORTFILES("rS") "s" \
1729 USE_FEATURE_AUTOWIDTH("T") USE_FEATURE_LS_TIMESTAMPS("tu") \
1730 USE_FEATURE_LS_SORTFILES("v") USE_FEATURE_AUTOWIDTH("w") "x" \
1731 USE_FEATURE_LS_SORTFILES("X") USE_FEATURE_HUMAN_READABLE("h") "k" \
1732 USE_SELINUX("K") "] [filenames...]"
1733#define ls_full_usage \
1734 "List directory contents\n\n" \
1735 "Options:\n" \
1736 " -1 list files in a single column\n" \
1737 " -A do not list implied . and ..\n" \
1738 " -a do not hide entries starting with .\n" \
1739 " -C list entries by columns\n" \
1740 USE_FEATURE_LS_TIMESTAMPS(" -c with -l: show ctime\n") \
1741 USE_FEATURE_LS_COLOR(" --color[={always,never,auto}] to control coloring\n") \
1742 " -d list directory entries instead of contents\n" \
1743 USE_FEATURE_LS_TIMESTAMPS(" -e list both full date and full time\n") \
1744 USE_FEATURE_LS_FILETYPES(" -F append indicator (one of */=@|) to entries\n") \
1745 " -i list the i-node for each file\n" \
1746 " -l use a long listing format\n" \
1747 " -n list numeric UIDs and GIDs instead of names\n" \
1748 USE_FEATURE_LS_FILETYPES(" -p append indicator (one of /=@|) to entries\n") \
1749 USE_FEATURE_LS_FOLLOWLINKS(" -L list entries pointed to by symbolic links\n") \
1750 USE_FEATURE_LS_RECURSIVE(" -R list subdirectories recursively\n") \
1751 USE_FEATURE_LS_SORTFILES(" -r sort the listing in reverse order\n") \
1752 USE_FEATURE_LS_SORTFILES(" -S sort the listing by file size\n") \
1753 " -s list the size of each file, in blocks\n" \
1754 USE_FEATURE_AUTOWIDTH(" -T NUM assume Tabstop every NUM columns\n") \
1755 USE_FEATURE_LS_TIMESTAMPS(" -t with -l: show modification time\n") \
1756 USE_FEATURE_LS_TIMESTAMPS(" -u with -l: show access time\n") \
1757 USE_FEATURE_LS_SORTFILES(" -v sort the listing by version\n") \
1758 USE_FEATURE_AUTOWIDTH(" -w NUM assume the terminal is NUM columns wide\n") \
1759 " -x list entries by lines instead of by columns\n" \
1760 USE_FEATURE_LS_SORTFILES(" -X sort the listing by extension\n") \
1761 USE_FEATURE_HUMAN_READABLE( \
1762 " -h print sizes in human readable format (e.g., 1K 243M 2G )\n") \
1763 USE_SELINUX(" -k print security context\n") \
1764 USE_SELINUX(" -K print security context in long format\n")
1765
1766#define lsattr_trivial_usage \
1767 "[-Radlv] [files...]"
1768#define lsattr_full_usage \
1769 "list file attributes on an ext2 fs\n\n" \
1770 "Options:\n" \
1771 " -R recursively list subdirectories\n" \
1772 " -a do not hide entries starting with .\n" \
1773 " -d list directory entries instead of contents\n" \
1774 " -l print long flag names\n" \
1775 " -v list the file's version/generation number"
1776
1777#define lsmod_trivial_usage \
1778 ""
1779#define lsmod_full_usage \
1780 "List the currently loaded kernel modules."
1781
1782#ifdef CONFIG_FEATURE_MAKEDEVS_LEAF
1783#define makedevs_trivial_usage \
1784 "NAME TYPE MAJOR MINOR FIRST LAST [s]"
1785#define makedevs_full_usage \
1786 "Creates a range of block or character special files\n\n" \
1787 "TYPEs include:\n" \
1788 " b: Make a block (buffered) device.\n" \
1789 " c or u: Make a character (un-buffered) device.\n" \
1790 " p: Make a named pipe. MAJOR and MINOR are ignored for named pipes.\n\n" \
1791 "FIRST specifies the number appended to NAME to create the first device.\n" \
1792 "LAST specifies the number of the last item that should be created\n" \
1793 "If 's' is the last argument, the base device is created as well.\n\n" \
1794 "For example:\n" \
1795 " makedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63\n" \
1796 " makedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8"
1797#define makedevs_example_usage \
1798 "# makedevs /dev/ttyS c 4 66 2 63\n" \
1799 "[creates ttyS2-ttyS63]\n" \
1800 "# makedevs /dev/hda b 3 0 0 8 s\n" \
1801 "[creates hda,hda1-hda8]\n"
1802#endif
1803
1804#ifdef CONFIG_FEATURE_MAKEDEVS_TABLE
1805#define makedevs_trivial_usage \
1806 "[-d device_table] rootdir"
1807#define makedevs_full_usage \
1808 "Creates a range of special files as specified in a device table.\n" \
1809 "Device table entries take the form of:\n" \
1810 "<type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>\n" \
1811 "Where name is the file name, type can be one of:\n" \
1812 " f A regular file\n" \
1813 " d Directory\n" \
1814 " c Character special device file\n" \
1815 " b Block special device file\n" \
1816 " p Fifo (named pipe)\n" \
1817 "uid is the user id for the target file, gid is the group id for the\n" \
1818 "target file. The rest of the entries (major, minor, etc) apply to\n" \
1819 "to device special files. A '-' may be used for blank entries."
1820#define makedevs_example_usage \
1821 "For example:\n" \
1822 "<name> <type> <mode><uid><gid><major><minor><start><inc><count>\n" \
1823 "/dev d 755 0 0 - - - - -\n" \
1824 "/dev/console c 666 0 0 5 1 - - -\n" \
1825 "/dev/null c 666 0 0 1 3 0 0 -\n" \
1826 "/dev/zero c 666 0 0 1 5 0 0 -\n" \
1827 "/dev/hda b 640 0 0 3 0 0 0 -\n" \
1828 "/dev/hda b 640 0 0 3 1 1 1 15\n\n" \
1829 "Will Produce:\n" \
1830 "/dev\n" \
1831 "/dev/console\n" \
1832 "/dev/null\n" \
1833 "/dev/zero\n" \
1834 "/dev/hda\n" \
1835 "/dev/hda[0-15]\n"
1836#endif
1837
1838#define md5sum_trivial_usage \
1839 "[OPTION] [FILEs...]" \
1840 USE_FEATURE_MD5_SHA1_SUM_CHECK("\n or: md5sum [OPTION] -c [FILE]")
1841#define md5sum_full_usage \
1842 "Print" USE_FEATURE_MD5_SHA1_SUM_CHECK(" or check") " MD5 checksums.\n\n" \
1843 "Options:\n" \
1844 "With no FILE, or when FILE is -, read standard input." \
1845 USE_FEATURE_MD5_SHA1_SUM_CHECK("\n\n" \
1846 " -c check MD5 sums against given list\n" \
1847 "\nThe following two options are useful only when verifying checksums:\n" \
1848 " -s don't output anything, status code shows success\n" \
1849 " -w warn about improperly formatted MD5 checksum lines")
1850#define md5sum_example_usage \
1851 "$ md5sum < busybox\n" \
1852 "6fd11e98b98a58f64ff3398d7b324003\n" \
1853 "$ md5sum busybox\n" \
1854 "6fd11e98b98a58f64ff3398d7b324003 busybox\n" \
1855 "$ md5sum -c -\n" \
1856 "6fd11e98b98a58f64ff3398d7b324003 busybox\n" \
1857 "busybox: OK\n" \
1858 "^D\n"
1859
1860#define mdev_trivial_usage \
1861 "[-s]"
1862#define mdev_full_usage \
1863 " -s Scan /sys and populate /dev during system boot\n\n" \
1864 "Called with no options (via hotplug) it uses environment variables\n" \
1865 "to determine which device to add/remove."
1866#define mdev_notes_usage "" \
1867USE_FEATURE_MDEV_CONFIG( \
1868 "The mdev config file contains lines that look like:\n" \
1869 " hd[a-z][0-9]* 0:3 660\n\n" \
1870 "That's device name (with regex match), uid:gid, and permissions.\n\n" \
1871 USE_FEATURE_MDEV_EXEC( \
1872 "Optionally, that can be followed (on the same line) by a special character\n" \
1873 "and a command line to run after creating/before deleting the corresponding\n" \
1874 "device(s). The environment variable $MDEV indicates the active device node\n" \
1875 "(which is useful if it's a regex match). For example:\n\n" \
1876 " hdc root:cdrom 660 *ln -s $MDEV cdrom\n\n" \
1877 "The special characters are @ (run after creating), $ (run before deleting),\n" \
1878 "and * (run both after creating and before deleting). The commands run in\n" \
1879 "the /dev directory, and use system() which calls /bin/sh.\n\n" \
1880 ) \
1881 "Config file parsing stops on the first matching line. If no config\n"\
1882 "entry is matched, devices are created with default 0:0 660. (Make\n"\
1883 "the last line match .* to override this.)\n\n" \
1884)
1885
1886#define mesg_trivial_usage \
1887 "[y|n]"
1888#define mesg_full_usage \
1889 "mesg controls write access to your terminal\n" \
1890 " y Allow write access to your terminal\n" \
1891 " n Disallow write access to your terminal"
1892
1893#define mkdir_trivial_usage \
1894 "[OPTION] DIRECTORY..."
1895#define mkdir_full_usage \
1896 "Create the DIRECTORY(ies) if they do not already exist\n\n" \
1897 "Options:\n" \
1898 " -m set permission mode (as in chmod), not rwxrwxrwx - umask\n" \
1899 " -p no error if existing, make parent directories as needed"
1900#define mkdir_example_usage \
1901 "$ mkdir /tmp/foo\n" \
1902 "$ mkdir /tmp/foo\n" \
1903 "/tmp/foo: File exists\n" \
1904 "$ mkdir /tmp/foo/bar/baz\n" \
1905 "/tmp/foo/bar/baz: No such file or directory\n" \
1906 "$ mkdir -p /tmp/foo/bar/baz\n"
1907
1908#define mke2fs_trivial_usage \
1909 "[-c|-l filename] [-b block-size] [-f fragment-size] [-g blocks-per-group] " \
1910 "[-i bytes-per-inode] [-j] [-J journal-options] [-N number-of-inodes] [-n] " \
1911 "[-m reserved-blocks-percentage] [-o creator-os] [-O feature[,...]] [-q] " \
1912 "[r fs-revision-level] [-E extended-options] [-v] [-F] [-L volume-label] " \
1913 "[-M last-mounted-directory] [-S] [-T filesystem-type] " \
1914 "device [blocks-count]"
1915#define mke2fs_full_usage \
1916 " -b size block size in bytes\n" \
1917 " -c check for bad blocks before creating\n" \
1918 " -E opts set extended options\n" \
1919 " -f size fragment size in bytes\n" \
1920 " -F force (ignore sanity checks)\n" \
1921 " -g num number of blocks in a block group\n" \
1922 " -i ratio the bytes/inode ratio\n" \
1923 " -j create a journal (ext3)\n" \
1924 " -J opts set journal options (size/device)\n" \
1925 " -l file read bad blocks list from file\n" \
1926 " -L lbl set the volume label\n" \
1927 " -m percent percent of fs blocks to reserve for admin\n" \
1928 " -M dir set last mounted directory\n" \
1929 " -n do not actually create anything\n" \
1930 " -N num number of inodes to create\n" \
1931 " -o os set the 'creator os' field\n" \
1932 " -O features dir_index/filetype/has_journal/journal_dev/sparse_super\n" \
1933 " -q quiet execution\n" \
1934 " -r rev set filesystem revision\n" \
1935 " -S write superblock and group descriptors only\n" \
1936 " -T fs-type set usage type (news/largefile/largefile4)\n" \
1937 " -v verbose execution"
1938
1939#define mkfifo_trivial_usage \
1940 "[OPTIONS] name"
1941#define mkfifo_full_usage \
1942 "Creates a named pipe (identical to 'mknod name p')\n\n" \
1943 "Options:\n" \
1944 " -m create the pipe using the specified mode (default a=rw)"
1945
1946#define mkfs_minix_trivial_usage \
1947 "[-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]"
1948#define mkfs_minix_full_usage \
1949 "Make a MINIX filesystem.\n\n" \
1950 "Options:\n" \
1951 " -c Check the device for bad blocks\n" \
1952 " -n [14|30] Specify the maximum length of filenames\n" \
1953 " -i INODES Specify the number of inodes for the filesystem\n" \
1954 " -l FILENAME Read the bad blocks list from FILENAME\n" \
1955 " -v Make a Minix version 2 filesystem"
1956
1957#define mknod_trivial_usage \
1958 "[OPTIONS] NAME TYPE MAJOR MINOR"
1959#define mknod_full_usage \
1960 "Create a special file (block, character, or pipe).\n\n" \
1961 "Options:\n" \
1962 " -m create the special file using the specified mode (default a=rw)\n\n" \
1963 "TYPEs include:\n" \
1964 " b: Make a block (buffered) device\n" \
1965 " c or u: Make a character (un-buffered) device\n" \
1966 " p: Make a named pipe. MAJOR and MINOR are ignored for named pipes"
1967#define mknod_example_usage \
1968 "$ mknod /dev/fd0 b 2 0\n" \
1969 "$ mknod -m 644 /tmp/pipe p\n"
1970
1971#define mkswap_trivial_usage \
1972 "[-c] [-v0|-v1] device [block-count]"
1973#define mkswap_full_usage \
1974 "Prepare a disk partition to be used as a swap partition.\n\n" \
1975 "Options:\n" \
1976 " -c Check for read-ability\n" \
1977 " -v0 Make version 0 swap [max 128 Megs]\n" \
1978 " -v1 Make version 1 swap [big!] (default for kernels >\n" \
1979 " 2.1.117)\n" \
1980 " block-count Number of block to use (default is entire partition)"
1981
1982#define mktemp_trivial_usage \
1983 "[-dq] TEMPLATE"
1984#define mktemp_full_usage \
1985 "Creates a temporary file with its name based on TEMPLATE.\n" \
1986 "TEMPLATE is any name with six 'Xs' (i.e., /tmp/temp.XXXXXX).\n\n" \
1987 "Options:\n" \
1988 " -d Make a directory instead of a file\n" \
1989 " -q Fail silently if an error occurs"
1990#define mktemp_example_usage \
1991 "$ mktemp /tmp/temp.XXXXXX\n" \
1992 "/tmp/temp.mWiLjM\n" \
1993 "$ ls -la /tmp/temp.mWiLjM\n" \
1994 "-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM\n"
1995
1996#define modprobe_trivial_usage \
1997 "[-knqrsv] MODULE [symbol=value ...]"
1998#define modprobe_full_usage \
1999 "Options:\n" \
2000 " -k Make module autoclean-able\n" \
2001 " -n Just show what would be done\n" \
2002 " -q Quiet output\n" \
2003 " -r Remove module (stacks) or do autoclean\n" \
2004 " -s Report via syslog instead of stderr\n" \
2005 " -v Verbose output"
2006#define modprobe_notes_usage \
2007"modprobe can (un)load a stack of modules, passing each module options (when\n" \
2008"loading). modprobe uses a configuration file to determine what option(s) to\n" \
2009"pass each module it loads.\n" \
2010"\n" \
2011"The configuration file is searched (in order) amongst:\n" \
2012"\n" \
2013" /etc/modprobe.conf (2.6 only)\n" \
2014" /etc/modules.conf\n" \
2015" /etc/conf.modules (deprecated)\n" \
2016"\n" \
2017"They all have the same syntax (see below). If none is present, it is\n" \
2018"_not_ an error; each loaded module is then expected to load without\n" \
2019"options. Once a file is found, the others are tested for.\n" \
2020"\n" \
2021"/etc/modules.conf entry format:\n" \
2022"\n" \
2023" alias <alias_name> <mod_name>\n" \
2024" Makes it possible to modprobe alias_name, when there is no such module.\n" \
2025" It makes sense if your mod_name is long, or you want a more representative\n" \
2026" name for that module (eg. 'scsi' in place of 'aha7xxx').\n" \
2027" This makes it also possible to use a different set of options (below) for\n" \
2028" the module and the alias.\n" \
2029" A module can be aliased more than once.\n" \
2030"\n" \
2031" options <mod_name|alias_name> <symbol=value ...>\n" \
2032" When loading module mod_name (or the module aliased by alias_name), pass\n" \
2033" the \"symbol=value\" pairs as option to that module.\n" \
2034"\n" \
2035"Sample /etc/modules.conf file:\n" \
2036"\n" \
2037" options tulip irq=3\n" \
2038" alias tulip tulip2\n" \
2039" options tulip2 irq=4 io=0x308\n" \
2040"\n" \
2041"Other functionality offered by 'classic' modprobe is not available in\n" \
2042"this implementation.\n" \
2043"\n" \
2044"If module options are present both in the config file, and on the command line,\n" \
2045"then the options from the command line will be passed to the module _after_\n" \
2046"the options from the config file. That way, you can have defaults in the config\n" \
2047"file, and override them for a specific usage from the command line.\n"
2048#define modprobe_example_usage \
2049 "(with the above /etc/modules.conf):\n\n" \
2050 "$ modprobe tulip\n" \
2051 " will load the module 'tulip' with default option 'irq=3'\n\n" \
2052 "$ modprobe tulip irq=5\n" \
2053 " will load the module 'tulip' with option 'irq=5', thus overriding the default\n\n" \
2054 "$ modprobe tulip2\n" \
2055 " will load the module 'tulip' with default options 'irq=4 io=0x308',\n" \
2056 " which are the default for alias 'tulip2'\n\n" \
2057 "$ modprobe tulip2 irq=8\n" \
2058 " will load the module 'tulip' with default options 'irq=4 io=0x308 irq=8',\n" \
2059 " which are the default for alias 'tulip2' overridden by the option 'irq=8'\n\n" \
2060 " from the command line\n\n" \
2061 "$ modprobe tulip2 irq=2 io=0x210\n" \
2062 " will load the module 'tulip' with default options 'irq=4 io=0x308 irq=4 io=0x210',\n" \
2063 " which are the default for alias 'tulip2' overridden by the options 'irq=2 io=0x210'\n\n" \
2064 " from the command line\n"
2065
2066#define more_trivial_usage \
2067 "[FILE ...]"
2068#define more_full_usage \
2069 "More is a filter for viewing FILE one screenful at a time."
2070#define more_example_usage \
2071 "$ dmesg | more\n"
2072
2073#define mount_trivial_usage \
2074 "[flags] DEVICE NODE [-o options,more-options]"
2075#define mount_full_usage \
2076 "Mount a filesystem. Filesystem autodetection requires /proc be mounted.\n\n" \
2077 "Flags:\n" \
2078 " -a: Mount all filesystems in fstab\n" \
2079 USE_FEATURE_MTAB_SUPPORT( \
2080 " -f: \"Fake\" Add entry to mount table but don't mount it\n" \
2081 " -n: Don't write a mount table entry\n" \
2082 ) \
2083 " -o option: One of many filesystem options, listed below\n" \
2084 " -r: Mount the filesystem read-only\n" \
2085 " -t fs-type: Specify the filesystem type\n" \
2086 " -w: Mount for reading and writing (default)\n" \
2087 "\n" \
2088 "Options for use with the \"-o\" flag:\n" \
2089 USE_FEATURE_MOUNT_LOOP( \
2090 " loop: Ignored (loop devices are autodetected)\n" \
2091 ) \
2092 USE_FEATURE_MOUNT_FLAGS( \
2093 " [a]sync: Writes are asynchronous / synchronous\n" \
2094 " [no]atime: Disable / enable updates to inode access times\n" \
2095 " [no]diratime: Disable / enable atime updates to directories\n" \
2096 " [no]dev: Allow use of special device files / disallow them\n" \
2097 " [no]exec: Allow use of executable files / disallow them\n" \
2098 " [no]suid: Allow set-user-id-root programs / disallow them\n" \
2099 " [r]shared: Convert [recursively] to a shared subtree.\n" \
2100 " [r]slave: Convert [recursively] to a slave subtree.\n" \
2101 " [r]private: Convert [recursively] to a private subtree\n" \
2102 " [un]bindable: Make mount point [un]able to be bind mounted.\n" \
2103 " bind: Bind a directory to an additional location\n" \
2104 " move: Relocate an existing mount point.\n" \
2105 ) \
2106 " remount: Re-mount a mounted filesystem, changing its flags\n" \
2107 " ro/rw: Mount for read-only / read-write\n" \
2108 "\nThere are EVEN MORE flags that are specific to each filesystem\n" \
2109 "You'll have to see the written documentation for those filesystems"
2110#define mount_example_usage \
2111 "$ mount\n" \
2112 "/dev/hda3 on / type minix (rw)\n" \
2113 "proc on /proc type proc (rw)\n" \
2114 "devpts on /dev/pts type devpts (rw)\n" \
2115 "$ mount /dev/fd0 /mnt -t msdos -o ro\n" \
2116 "$ mount /tmp/diskimage /opt -t ext2 -o loop\n" \
2117 "$ mount cd_image.iso mydir\n"
2118#define mount_notes_usage \
2119 "Returns 0 for success, number of failed mounts for -a, or errno for one mount."
2120
2121#define mountpoint_trivial_usage \
2122 "[-q] <[-d] DIR | -x DEVICE>"
2123#define mountpoint_full_usage \
2124 "mountpoint checks if the directory is a mountpoint\n\n" \
2125 "Options:\n" \
2126 " -q Be more quiet\n" \
2127 " -d Print major/minor device number of the filesystem\n" \
2128 " -x Print major/minor device number of the blockdevice"
2129#define mountpoint_example_usage \
2130 "$ mountpoint /proc\n" \
2131 "/proc is not a mountpoint\n" \
2132 "$ mountpoint /sys\n" \
2133 "/sys is a mountpoint\n"
2134
2135#define mt_trivial_usage \
2136 "[-f device] opcode value"
2137#define mt_full_usage \
2138 "Control magnetic tape drive operation\n" \
2139 "\nAvailable Opcodes:\n\n" \
2140 "bsf bsfm bsr bss datacompression drvbuffer eof eom erase\n" \
2141 "fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2\n" \
2142 "ras3 reset retension rewind rewoffline seek setblk setdensity\n" \
2143 "setpart tell unload unlock weof wset"
2144
2145#define mv_trivial_usage \
2146 "[OPTION]... SOURCE DEST\n" \
2147 "or: mv [OPTION]... SOURCE... DIRECTORY"
2148#define mv_full_usage \
2149 "Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\n" \
2150 "Options:\n" \
2151 " -f don't prompt before overwriting\n" \
2152 " -i interactive, prompt before overwrite"
2153#define mv_example_usage \
2154 "$ mv /tmp/foo /bin/bar\n"
2155
2156#define nameif_trivial_usage \
2157 "[-s] [-c FILE] [{IFNAME MACADDR}]"
2158#define nameif_full_usage \
2159 "Nameif renames network interface while it in the down state.\n\n" \
2160 "Options:\n" \
2161 " -c FILE Use configuration file (default is /etc/mactab)\n" \
2162 " -s Use syslog (LOCAL0 facility)\n" \
2163 " IFNAME MACADDR new_interface_name interface_mac_address"
2164#define nameif_example_usage \
2165 "$ nameif -s dmz0 00:A0:C9:8C:F6:3F\n" \
2166 " or\n" \
2167 "$ nameif -c /etc/my_mactab_file\n" \
2168
2169#if ENABLE_NC_SERVER || ENABLE_NC_EXTRA
2170#define NC_OPTIONS_STR "\n\nOptions:"
2171#else
2172#define NC_OPTIONS_STR
2173#endif
2174
2175#define nc_trivial_usage \
2176 USE_NC_EXTRA("[-iN] [-wN] ")USE_NC_SERVER("[-l] [-p PORT] ") \
2177 "["USE_NC_EXTRA("-f FILENAME|")"IPADDR PORTNUM]"USE_NC_EXTRA(" [-e COMMAND]")
2178#define nc_full_usage \
2179 "Netcat opens a pipe to IP:port" USE_NC_EXTRA(" or file") \
2180 NC_OPTIONS_STR \
2181 USE_NC_EXTRA( \
2182 "\n -e exec rest of command line after connect\n" \
2183 " -i SECS delay interval for lines sent\n" \
2184 " -w SECS timeout for connect\n" \
2185 " -f file use file (ala /dev/ttyS0) instead of network" \
2186 ) \
2187 USE_NC_SERVER( \
2188 "\n -l listen mode, for inbound connects\n" \
2189 USE_NC_EXTRA(" (use -l twice with -e for persistent server)\n") \
2190 " -p PORT local port number" \
2191 )
2192
2193#define nc_notes_usage "" \
2194 USE_NC_EXTRA( \
2195 "To use netcat as a terminal emulator on a serial port:\n\n" \
2196 "$ stty 115200 -F /dev/ttyS0\n" \
2197 "$ stty raw -echo -ctlecho && nc -f /dev/ttyS0\n" \
2198 ) ""
2199
2200#define nc_example_usage \
2201 "$ nc foobar.somedomain.com 25\n" \
2202 "220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600\n" \
2203 "help\n" \
2204 "214-Commands supported:\n" \
2205 "214- HELO EHLO MAIL RCPT DATA AUTH\n" \
2206 "214 NOOP QUIT RSET HELP\n" \
2207 "quit\n" \
2208 "221 foobar closing connection\n"
2209
2210#define netstat_trivial_usage \
2211 "[-laenrtuwx]"
2212#define netstat_full_usage \
2213 "Netstat displays Linux networking information.\n\n" \
2214 "Options:\n" \
2215 " -l display listening server sockets\n" \
2216 " -a display all sockets (default: connected)\n" \
2217 " -e display other/more information\n" \
2218 " -n don't resolve names\n" \
2219 " -r display routing table\n" \
2220 " -t tcp sockets\n" \
2221 " -u udp sockets\n" \
2222 " -w raw sockets\n" \
2223 " -x unix sockets"
2224
2225#define nice_trivial_usage \
2226 "[-n ADJUST] [COMMAND [ARG] ...]"
2227#define nice_full_usage \
2228 "Nice runs a program with modified scheduling priority.\n\n" \
2229 "Options:\n" \
2230 " -n ADJUST Adjust the scheduling priority by ADJUST"
2231
2232#define nmeter_trivial_usage \
2233 "format_string"
2234#define nmeter_full_usage \
2235 "Nmeter monitors your system in real time.\n\n" \
2236 "Format specifiers:\n" \
2237 "%Nc or %[cN] monitor CPU. N - bar size, default 10\n" \
2238 " (displays: S:system U:user N:niced D:iowait I:irq i:softirq)\n" \
2239 "%[niface] monitor network interface 'iface'\n" \
2240 "%m monitor allocated memory\n" \
2241 "%[mf] monitor free memory\n" \
2242 "%[mt] monitor total memory\n" \
2243 "%s monitor allocated swap\n" \
2244 "%f monitor number of used file descriptors\n" \
2245 "%Ni monitor total/specific IRQ rate\n" \
2246 "%x monitor context switch rate\n" \
2247 "%p monitor forks\n" \
2248 "%[pn] monitor # of processes\n" \
2249 "%b monitor block io\n" \
2250 "%Nt show time (with N decimal points)\n" \
2251 "%Nd milliseconds between updates (default=1000)\n" \
2252 "%r print <cr> instead of <lf> at EOL"
2253#define nmeter_example_usage \
2254 "nmeter '%250d%t %20c int %i bio %b mem %m forks%p'"
2255
2256#define nohup_trivial_usage \
2257 "COMMAND [ARGS]"
2258#define nohup_full_usage \
2259 "run a command immune to hangups, with output to a non-tty"
2260#define nohup_example_usage \
2261 "$ nohup make &"
2262
2263#define nslookup_trivial_usage \
2264 "[HOST] [SERVER]"
2265#define nslookup_full_usage \
2266 "Queries the nameserver for the IP address of the given HOST\n" \
2267 "optionally using a specified DNS server"
2268#define nslookup_example_usage \
2269 "$ nslookup localhost\n" \
2270 "Server: default\n" \
2271 "Address: default\n" \
2272 "\n" \
2273 "Name: debian\n" \
2274 "Address: 127.0.0.1\n"
2275
2276#define od_trivial_usage \
2277 "[-aBbcDdeFfHhIiLlOovXx] [FILE]"
2278#define od_full_usage \
2279 "Write an unambiguous representation, octal bytes by default, of FILE\n" \
2280 "to standard output. With no FILE, or when FILE is -, read standard input."
2281
2282#define openvt_trivial_usage \
2283 "<vtnum> <COMMAND> [ARGS...]"
2284#define openvt_full_usage \
2285 "Start a command on a new virtual terminal"
2286#define openvt_example_usage \
2287 "openvt 2 /bin/ash\n"
2288
2289#define passwd_trivial_usage \
2290 "[OPTION] [name]"
2291#define passwd_full_usage \
2292 "Change a user password. If no name is specified,\n" \
2293 "changes the password for the current user.\n" \
2294 "Options:\n" \
2295 " -a Define which algorithm shall be used for the password\n" \
2296 " (Choices: des, md5, sha1)\n" \
2297 " -d Delete the password for the specified user account\n" \
2298 " -l Locks (disables) the specified user account\n" \
2299 " -u Unlocks (re-enables) the specified user account"
2300
2301#define patch_trivial_usage \
2302 "[-p<num>] [-i <diff>]"
2303#define patch_full_usage \
2304 " -p <num> Strip <num> leading components from file names\n" \
2305 " -i <diff> Read <diff> instead of stdin"
2306#define patch_example_usage \
2307 "$ patch -p1 < example.diff\n" \
2308 "$ patch -p0 -i example.diff"
2309
2310#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT)
2311#define USAGE_PIDOF "Options:"
2312#else
2313#define USAGE_PIDOF "\n This version of pidof accepts no options."
2314#endif
2315
2316#define pidof_trivial_usage \
2317 "process-name [OPTION] [process-name ...]"
2318
2319#define pidof_full_usage \
2320 "Lists the PIDs of all processes with names that match the\n" \
2321 "names on the command line.\n" \
2322 USAGE_PIDOF \
2323 USE_FEATURE_PIDOF_SINGLE("\n -s display only a single PID") \
2324 USE_FEATURE_PIDOF_OMIT("\n -o omit given pid.") \
2325 USE_FEATURE_PIDOF_OMIT("\n Use %PPID to omit the parent pid of pidof itself")
2326#define pidof_example_usage \
2327 "$ pidof init\n" \
2328 "1\n" \
2329 USE_FEATURE_PIDOF_OMIT("$ pidof /bin/sh\n20351 5973 5950\n") \
2330 USE_FEATURE_PIDOF_OMIT("$ pidof /bin/sh -o %PPID\n20351 5950")
2331
2332#ifndef CONFIG_FEATURE_FANCY_PING
2333#define ping_trivial_usage "host"
2334#define ping_full_usage "Send ICMP ECHO_REQUEST packets to network hosts"
2335#else
2336#define ping_trivial_usage \
2337 "[OPTION]... host"
2338#define ping_full_usage \
2339 "Send ICMP ECHO_REQUEST packets to network hosts.\n\n" \
2340 "Options:\n" \
2341 " -c COUNT Send only COUNT pings\n" \
2342 " -s SIZE Send SIZE data bytes in packets (default=56)\n" \
2343 " -I IPADDR Use IPADDR as source address\n" \
2344 " -q Quiet mode, only displays output at start\n" \
2345 " and when finished"
2346#endif
2347#define ping_example_usage \
2348 "$ ping localhost\n" \
2349 "PING slag (127.0.0.1): 56 data bytes\n" \
2350 "64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms\n" \
2351 "\n" \
2352 "--- debian ping statistics ---\n" \
2353 "1 packets transmitted, 1 packets received, 0% packet loss\n" \
2354 "round-trip min/avg/max = 20.1/20.1/20.1 ms\n"
2355
2356#ifndef CONFIG_FEATURE_FANCY_PING6
2357#define ping6_trivial_usage "host"
2358#define ping6_full_usage "Send ICMP ECHO_REQUEST packets to network hosts"
2359#else
2360#define ping6_trivial_usage \
2361 "[OPTION]... host"
2362#define ping6_full_usage \
2363 "Send ICMP ECHO_REQUEST packets to network hosts.\n\n" \
2364 "Options:\n" \
2365 " -c COUNT Send only COUNT pings\n" \
2366 " -s SIZE Send SIZE data bytes in packets (default=56)\n" \
2367 " -q Quiet mode, only displays output at start\n" \
2368 " and when finished"
2369#endif
2370#define ping6_example_usage \
2371 "$ ping6 ip6-localhost\n" \
2372 "PING ip6-localhost (::1): 56 data bytes\n" \
2373 "64 bytes from ::1: icmp6_seq=0 ttl=64 time=20.1 ms\n" \
2374 "\n" \
2375 "--- ip6-localhost ping statistics ---\n" \
2376 "1 packets transmitted, 1 packets received, 0% packet loss\n" \
2377 "round-trip min/avg/max = 20.1/20.1/20.1 ms\n"
2378
2379#define pivot_root_trivial_usage \
2380 "NEW_ROOT PUT_OLD"
2381#define pivot_root_full_usage \
2382 "Move the current root file system to PUT_OLD and make NEW_ROOT\n" \
2383 "the new root file system."
2384
2385#define poweroff_trivial_usage \
2386 "[-d<delay>] [-n<nosync>] [-f<force>]"
2387#define poweroff_full_usage \
2388 "Halt and shut off power.\n" \
2389 "Options:\n" \
2390 " -d delay interval for halting\n" \
2391 " -n no call to sync()\n" \
2392 " -f force power off (don't go through init)"
2393
2394#define printenv_trivial_usage \
2395 "[VARIABLES...]"
2396#define printenv_full_usage \
2397 "print all or part of environment\n\n" \
2398 "If no environment VARIABLE specified, print them all."
2399
2400#define printf_trivial_usage \
2401 "FORMAT [ARGUMENT...]"
2402#define printf_full_usage \
2403 "Formats and prints ARGUMENT(s) according to FORMAT,\n" \
2404 "Where FORMAT controls the output exactly as in C printf."
2405#define printf_example_usage \
2406 "$ printf \"Val=%d\\n\" 5\n" \
2407 "Val=5\n"
2408
2409
2410#if ENABLE_DESKTOP
2411
2412#define ps_trivial_usage \
2413 ""
2414#define ps_full_usage \
2415 "Report process status\n" \
2416 "\nOptions:" \
2417 "\n -o col1,col2=header Select columns for display" \
2418
2419#else /* !ENABLE_DESKTOP */
2420
2421#if !defined CONFIG_SELINUX && !ENABLE_FEATURE_PS_WIDE
2422#define USAGE_PS "\n This version of ps accepts no options."
2423#else
2424#define USAGE_PS "\nOptions:"
2425#endif
2426
2427#define ps_trivial_usage \
2428 ""
2429#define ps_full_usage \
2430 "Report process status\n" \
2431 USAGE_PS \
2432 USE_SELINUX("\n -c show SE Linux context") \
2433 USE_FEATURE_PS_WIDE("\n w wide output")
2434
2435#endif /* ENABLE_DESKTOP */
2436
2437#define ps_example_usage \
2438 "$ ps\n" \
2439 " PID Uid Gid State Command\n" \
2440 " 1 root root S init\n" \
2441 " 2 root root S [kflushd]\n" \
2442 " 3 root root S [kupdate]\n" \
2443 " 4 root root S [kpiod]\n" \
2444 " 5 root root S [kswapd]\n" \
2445 " 742 andersen andersen S [bash]\n" \
2446 " 743 andersen andersen S -bash\n" \
2447 " 745 root root S [getty]\n" \
2448 " 2990 andersen andersen R ps\n"
2449
2450
2451#define pwd_trivial_usage \
2452 ""
2453#define pwd_full_usage \
2454 "Print the full filename of the current working directory."
2455#define pwd_example_usage \
2456 "$ pwd\n" \
2457 "/root\n"
2458
2459#define raidautorun_trivial_usage \
2460 "DEVICE"
2461#define raidautorun_full_usage \
2462 "Tells the kernel to automatically search and start RAID arrays"
2463#define raidautorun_example_usage \
2464 "$ raidautorun /dev/md0"
2465
2466#define rdate_trivial_usage \
2467 "[-sp] HOST"
2468#define rdate_full_usage \
2469 "Get and possibly set the system date and time from a remote HOST.\n\n" \
2470 "Options:\n" \
2471 " -s Set the system date and time (default)\n" \
2472 " -p Print the date and time"
2473
2474#define readahead_trivial_usage \
2475 "[FILE]..."
2476#define readahead_full_usage \
2477 "Preloads FILE(s) in RAM cache so that subsequent reads for those" \
2478 "files do not block on disk I/O."
2479
2480#define readlink_trivial_usage \
2481 USE_FEATURE_READLINK_FOLLOW("[-f] ") "FILE"
2482#define readlink_full_usage \
2483 "Displays the value of a symbolic link." \
2484 USE_FEATURE_READLINK_FOLLOW("\n\nOptions:\n" \
2485 " -f canonicalize by following all symlinks")
2486
2487#define readprofile_trivial_usage \
2488 "[OPTIONS]..."
2489#define readprofile_full_usage \
2490 "Options:\n" \
2491 " -m <mapfile> (default: /boot/System.map)\n" \
2492 " -p <profile> (default: /proc/profile)\n" \
2493 " -M <mult> set the profiling multiplier to <mult>\n" \
2494 " -i print only info about the sampling step\n" \
2495 " -v print verbose data\n" \
2496 " -a print all symbols, even if count is 0\n" \
2497 " -b print individual histogram-bin counts\n" \
2498 " -s print individual counters within functions\n" \
2499 " -r reset all the counters (root only)\n" \
2500 " -n disable byte order auto-detection"
2501
2502#define realpath_trivial_usage \
2503 "pathname ..."
2504#define realpath_full_usage \
2505 "Returns the absolute pathnames of given argument."
2506
2507#define reboot_trivial_usage \
2508 "[-d<delay>] [-n<nosync>] [-f<force>]"
2509#define reboot_full_usage \
2510 "Reboot the system.\n" \
2511 "Options:\n" \
2512 " -d delay interval for rebooting\n" \
2513 " -n no call to sync()\n" \
2514 " -f force reboot (don't go through init)"
2515
2516#define renice_trivial_usage \
2517 "{{-n INCREMENT} | PRIORITY} [[ -p | -g | -u ] ID ...]"
2518#define renice_full_usage \
2519 "Changes priority of running processes.\n\n" \
2520 "Options:\n" \
2521 " -n adjusts current nice value (smaller is faster)\n" \
2522 " -p process id(s) (default)\n" \
2523 " -g process group id(s)\n" \
2524 " -u process user name(s) and/or id(s)"
2525
2526#define reset_trivial_usage \
2527 ""
2528#define reset_full_usage \
2529 "Resets the screen."
2530
2531#define resize_trivial_usage \
2532 ""
2533#define resize_full_usage \
2534 "Resizes the screen."
2535
2536#define rm_trivial_usage \
2537 "[OPTION]... FILE..."
2538#define rm_full_usage \
2539 "Remove (unlink) the FILE(s). You may use '--' to\n" \
2540 "indicate that all following arguments are non-options.\n\n" \
2541 "Options:\n" \
2542 " -i always prompt before removing each destination\n" \
2543 " -f remove existing destinations, never prompt\n" \
2544 " -r or -R remove the contents of directories recursively"
2545#define rm_example_usage \
2546 "$ rm -rf /tmp/foo\n"
2547
2548#define rmdir_trivial_usage \
2549 "[OPTION]... DIRECTORY..."
2550#define rmdir_full_usage \
2551 "Remove the DIRECTORY(ies), if they are empty."
2552#define rmdir_example_usage \
2553 "# rmdir /tmp/foo\n"
2554
2555#define rmmod_trivial_usage \
2556 "[OPTION]... [MODULE]..."
2557#define rmmod_full_usage \
2558 "Unloads the specified kernel modules from the kernel.\n\n" \
2559 "Options:\n" \
2560 " -a Remove all unused modules (recursively)"
2561#define rmmod_example_usage \
2562 "$ rmmod tulip\n"
2563
2564#define route_trivial_usage \
2565 "[{add|del|delete}]"
2566#define route_full_usage \
2567 "Edit the kernel's routing tables.\n\n" \
2568 "Options:\n" \
2569 " -n Dont resolve names\n" \
2570 " -e Display other/more information\n" \
2571 " -A inet" USE_FEATURE_IPV6("{6}") " Select address family"
2572
2573#define rpm_trivial_usage \
2574 "-i -q[ildc]p package.rpm"
2575#define rpm_full_usage \
2576 "Manipulates RPM packages" \
2577 "\n\nOptions:" \
2578 "\n -i Install package" \
2579 "\n -q Query package" \
2580 "\n -p Query uninstalled package" \
2581 "\n -i Show information" \
2582 "\n -l List contents" \
2583 "\n -d List documents" \
2584 "\n -c List config files"
2585
2586#define rpm2cpio_trivial_usage \
2587 "package.rpm"
2588#define rpm2cpio_full_usage \
2589 "Outputs a cpio archive of the rpm file."
2590
2591#define run_parts_trivial_usage \
2592 "[-t] [-a ARG] [-u MASK] DIRECTORY"
2593#define run_parts_full_usage \
2594 "Run a bunch of scripts in a directory.\n\n" \
2595 "Options:\n" \
2596 " -t Prints what would be run, but does not actually run anything\n" \
2597 " -a ARG Pass ARG as an argument for every program invoked\n" \
2598 " -u MASK Set the umask to MASK before executing every program"
2599
2600#define runlevel_trivial_usage \
2601 "[utmp]"
2602#define runlevel_full_usage \
2603 "Find the current and previous system runlevel.\n\n" \
2604 "If no utmp file exists or if no runlevel record can be found,\n" \
2605 "runlevel prints \"unknown\""
2606#define runlevel_example_usage \
2607 "$ runlevel /var/run/utmp\n" \
2608 "N 2"
2609
2610#define runsv_trivial_usage \
2611 "dir"
2612#define runsv_full_usage \
2613 "Start and monitor a service and optionally an appendant log service."
2614
2615#define runsvdir_trivial_usage \
2616 "[-P] dir"
2617#define runsvdir_full_usage \
2618 "Start a runsv process for each subdirectory."
2619
2620#define rx_trivial_usage \
2621 "FILE"
2622#define rx_full_usage \
2623 "Receive a file using the xmodem protocol."
2624#define rx_example_usage \
2625 "$ rx /tmp/foo\n"
2626
2627#define sed_trivial_usage \
2628 "[-efinr] pattern [files...]"
2629#define sed_full_usage \
2630 "Options:\n" \
2631 " -e script add the script to the commands to be executed\n" \
2632 " -f scriptfile add script-file contents to the\n" \
2633 " commands to be executed\n" \
2634 " -i edit files in-place\n" \
2635 " -n suppress automatic printing of pattern space\n" \
2636 " -r use extended regular expression syntax\n" \
2637 "\n" \
2638 "If no -e or -f is given, the first non-option argument is taken as the sed\n" \
2639 "script to interpret. All remaining arguments are names of input files; if no\n" \
2640 "input files are specified, then the standard input is read. Source files\n" \
2641 "will not be modified unless -i option is given."
2642
2643#define sed_example_usage \
2644 "$ echo \"foo\" | sed -e 's/f[a-zA-Z]o/bar/g'\n" \
2645 "bar\n"
2646
2647#define seq_trivial_usage \
2648 "[first [increment]] last"
2649#define seq_full_usage \
2650 "Print numbers from FIRST to LAST, in steps of INCREMENT.\n" \
2651 "FIRST, INCREMENT default to 1\n" \
2652 "Arguments:\n" \
2653 " LAST\n" \
2654 " FIRST LAST\n" \
2655 " FIRST INCREMENT LAST"
2656
2657#define setconsole_trivial_usage \
2658 "[-r|--reset] [DEVICE]"
2659#define setconsole_full_usage \
2660 "Redirects system console output to DEVICE (default: /dev/tty).\n\n" \
2661 "Options:\n" \
2662 " -r Reset output to /dev/console."
2663
2664#define setkeycodes_trivial_usage \
2665 "SCANCODE KEYCODE ..."
2666#define setkeycodes_full_usage \
2667 "Set entries into the kernel's scancode-to-keycode map,\n" \
2668 "allowing unusual keyboards to generate usable keycodes.\n\n" \
2669 "SCANCODE may be either xx or e0xx (hexadecimal),\n" \
2670 "and KEYCODE is given in decimal"
2671#define setkeycodes_example_usage \
2672 "$ setkeycodes e030 127\n"
2673
2674#define setlogcons_trivial_usage \
2675 "N"
2676#define setlogcons_full_usage \
2677 "Redirects the kernel output to console N (0 for current)."
2678
2679#define setsid_trivial_usage \
2680 "program [arg ...]"
2681#define setsid_full_usage \
2682 "Runs any program in a new session by calling setsid() before\n" \
2683 "exec'ing the rest of its arguments. See setsid(2) for details."
2684
2685#define lash_trivial_usage \
2686 "[FILE]...\n" \
2687 "or: sh -c command [args]..."
2688#define lash_full_usage \
2689 "The BusyBox LAme SHell (command interpreter)"
2690#define lash_notes_usage \
2691 "This command does not yet have proper documentation.\n\n" \
2692 "Use lash just as you would use any other shell. It properly handles pipes,\n" \
2693 "redirects, job control, can be used as the shell for scripts, and has a\n" \
2694 "sufficient set of builtins to do what is needed. It does not (yet) support\n" \
2695 "Bourne Shell syntax. If you need things like \"if-then-else\", \"while\", and such\n" \
2696 "use ash or bash. If you just need a very simple and extremely small shell,\n" \
2697 "this will do the job."
2698
2699#define last_trivial_usage \
2700 ""
2701#define last_full_usage \
2702 "Shows listing of the last users that logged into the system"
2703
2704#define sha1sum_trivial_usage \
2705 "[OPTION] [FILEs...]" \
2706 USE_FEATURE_MD5_SHA1_SUM_CHECK("\n or: sha1sum [OPTION] -c [FILE]")
2707#define sha1sum_full_usage \
2708 "Print" USE_FEATURE_MD5_SHA1_SUM_CHECK(" or check") " SHA1 checksums.\n\n" \
2709 "Options:\n" \
2710 "With no FILE, or when FILE is -, read standard input." \
2711 USE_FEATURE_MD5_SHA1_SUM_CHECK("\n\n" \
2712 " -c check SHA1 sums against given list\n" \
2713 "\nThe following two options are useful only when verifying checksums:\n" \
2714 " -s don't output anything, status code shows success\n" \
2715 " -w warn about improperly formatted SHA1 checksum lines")
2716
2717#define sleep_trivial_usage \
2718 USE_FEATURE_FANCY_SLEEP("[") "N" USE_FEATURE_FANCY_SLEEP("]...")
2719#define sleep_full_usage \
2720 SKIP_FEATURE_FANCY_SLEEP("Pause for N seconds.") \
2721 USE_FEATURE_FANCY_SLEEP( \
2722 "Pause for a time equal to the total of the args given, where each arg can\n" \
2723 " have an optional suffix of (s)econds, (m)inutes, (h)ours, or (d)ays.")
2724#define sleep_example_usage \
2725 "$ sleep 2\n" \
2726 "[2 second delay results]\n" \
2727 USE_FEATURE_FANCY_SLEEP("$ sleep 1d 3h 22m 8s\n" \
2728 "[98528 second delay results]\n")
2729
2730#define sort_trivial_usage \
2731 "[-nru" USE_FEATURE_SORT_BIG("gMcszbdfimSTokt] [-o outfile] [-k start[.offset][opts][,end[.offset][opts]] [-t char") "] [FILE]..."
2732#define sort_full_usage \
2733 "Sorts lines of text in the specified files\n\n" \
2734 "Options:\n" \
2735 USE_FEATURE_SORT_BIG( \
2736 " -b ignore leading blanks\n" \
2737 " -c check whether input is sorted\n" \
2738 " -d dictionary order (blank or alphanumeric only)\n" \
2739 " -f ignore case\n" \
2740 " -g general numerical sort\n" \
2741 " -i ignore unprintable characters\n" \
2742 " -k specify sort key\n" \
2743 " -M sort month\n" \
2744 ) \
2745 " -n sort numbers\n" \
2746 USE_FEATURE_SORT_BIG( \
2747 " -o output to file\n" \
2748 " -k sort by key\n" \
2749 " -t use key separator other than whitespace\n" \
2750 ) \
2751 " -r reverse sort order\n" \
2752 USE_FEATURE_SORT_BIG(" -s stable (don't sort ties alphabetically)\n") \
2753 " -u suppress duplicate lines" \
2754 USE_FEATURE_SORT_BIG("\n -z input terminated by nulls, not newlines\n") \
2755 USE_FEATURE_SORT_BIG(" -mST ignored for GNU compatibility") \
2756 ""
2757#define sort_example_usage \
2758 "$ echo -e \"e\\nf\\nb\\nd\\nc\\na\" | sort\n" \
2759 "a\n" \
2760 "b\n" \
2761 "c\n" \
2762 "d\n" \
2763 "e\n" \
2764 "f\n" \
2765 USE_FEATURE_SORT_BIG( \
2766 "$ echo -e \"c 3\\nb 2\\nd 2\" | $SORT -k 2,2n -k 1,1r\n" \
2767 "d 2\n" \
2768 "b 2\n" \
2769 "c 3\n" \
2770 ) \
2771 ""
2772
2773#define start_stop_daemon_trivial_usage \
2774 "[OPTIONS] [--start|--stop] ... [-- arguments...]"
2775#define start_stop_daemon_full_usage \
2776 "Program to start and stop services." \
2777 "\n\nOptions:" \
2778 "\n -S|--start start" \
2779 "\n -K|--stop stop" \
2780 "\n -a|--startas <pathname> starts process specified by pathname" \
2781 "\n -b|--background force process into background" \
2782 "\n -u|--user <username>|<uid> stop this user's processes" \
2783 "\n -x|--exec <executable> program to either start or check" \
2784 "\n -m|--make-pidfile create the -p file and enter pid in it" \
2785 "\n -n|--name <process-name> stop processes with this name" \
2786 "\n -p|--pidfile <pid-file> save or load pid using a pid-file" \
2787 "\n -q|--quiet be quiet" \
2788USE_FEATURE_START_STOP_DAEMON_FANCY( \
2789 "\n -o|--oknodo exit status 0 if nothing done" \
2790 "\n -v|--verbose be verbose" \
2791 "\n -N|--nicelevel <N> add N to process's nice level" \
2792) \
2793 "\n -s|--signal <signal> signal to send (default TERM)" \
2794 "\n -U|--chuid <username>|<uid> start process with this name"
2795
2796#define stat_trivial_usage \
2797 "[OPTION] FILE..."
2798#define stat_full_usage \
2799 "display file (default) or filesystem status.\n\n" \
2800 "Options:\n" \
2801 USE_FEATURE_STAT_FORMAT(" -c fmt use the specified format\n") \
2802 " -f display filesystem status\n" \
2803 " -L,-l dereference links\n" \
2804 " -t display info in terse form\n" \
2805 USE_FEATURE_STAT_FORMAT( \
2806 "\nValid format sequences for files:\n" \
2807 " %a Access rights in octal\n" \
2808 " %A Access rights in human readable form\n" \
2809 " %b Number of blocks allocated (see %B)\n" \
2810 " %B The size in bytes of each block reported by %b\n" \
2811 " %d Device number in decimal\n" \
2812 " %D Device number in hex\n" \
2813 " %f Raw mode in hex\n" \
2814 " %F File type\n" \
2815 " %g Group ID of owner\n" \
2816 " %G Group name of owner\n" \
2817 " %h Number of hard links\n" \
2818 " %i Inode number\n" \
2819 " %n File name\n" \
2820 " %N Quoted file name with dereference if symbolic link\n" \
2821 " %o I/O block size\n" \
2822 " %s Total size, in bytes\n" \
2823 " %t Major device type in hex\n" \
2824 " %T Minor device type in hex\n" \
2825 " %u User ID of owner\n" \
2826 " %U User name of owner\n" \
2827 " %x Time of last access\n" \
2828 " %X Time of last access as seconds since Epoch\n" \
2829 " %y Time of last modification\n" \
2830 " %Y Time of last modification as seconds since Epoch\n" \
2831 " %z Time of last change\n" \
2832 " %Z Time of last change as seconds since Epoch\n" \
2833 "\nValid format sequences for file systems:\n" \
2834 " %a Free blocks available to non-superuser\n" \
2835 " %b Total data blocks in file system\n" \
2836 " %c Total file nodes in file system\n" \
2837 " %d Free file nodes in file system\n" \
2838 " %f Free blocks in file system\n" \
2839 " %i File System ID in hex\n" \
2840 " %l Maximum length of filenames\n" \
2841 " %n File name\n" \
2842 " %s Block size (for faster transfers)\n" \
2843 " %S Fundamental block size (for block counts)\n" \
2844 " %t Type in hex\n" \
2845 " %T Type in human readable form\n" \
2846 )
2847
2848#define strings_trivial_usage \
2849 "[-afo] [-n length] [file ... ]"
2850#define strings_full_usage \
2851 "Display printable strings in a binary file." \
2852 "\n\nOptions:" \
2853 "\n -a Scan the whole files (this is the default)." \
2854 "\n -f Precede each string with the name of the file where it was found." \
2855 "\n -n N Specifies that at least N characters forms a sequence (default 4)" \
2856 "\n -o Each string is preceded by its decimal offset in the file"
2857
2858#define stty_trivial_usage \
2859 "[-a|g] [-F DEVICE] [SETTING]..."
2860#define stty_full_usage \
2861 "Without arguments, prints baud rate, line discipline," \
2862 "\nand deviations from stty sane." \
2863 "\n\nOptions:" \
2864 "\n -F DEVICE open device instead of stdin" \
2865 "\n -a print all current settings in human-readable form" \
2866 "\n -g print in stty-readable form" \
2867 "\n [SETTING] see manpage"
2868
2869#define su_trivial_usage \
2870 "[OPTION]... [-] [username]"
2871#define su_full_usage \
2872 "Change user id or become root.\n" \
2873 "Options:\n" \
2874 " -p, -m Preserve environment" \
2875 "\n -c Command to pass to 'sh -c'" \
2876 "\n -s Shell to use instead of default shell"
2877
2878#define sulogin_trivial_usage \
2879 "[OPTION]... [tty-device]"
2880#define sulogin_full_usage \
2881 "Single user login\n" \
2882 "Options:\n" \
2883 " -t Timeout"
2884
2885#define sum_trivial_usage \
2886 "[rs] [files...]"
2887#define sum_full_usage \
2888 "checksum and count the blocks in a file\n\n" \
2889 "Options:\n" \
2890 " -r use BSD sum algorithm (1K blocks)\n" \
2891 " -s use System V sum algorithm (512byte blocks)"
2892
2893#define sv_trivial_usage \
2894 "[-v] [-w sec] command service..."
2895#define sv_full_usage \
2896 "Report the current status and control the state of services " \
2897 "monitored by the runsv supervisor."
2898
2899#define svlogd_trivial_usage \
2900 "[-ttv] [-r c] [-R abc] [-l len] [-b buflen] dir..."
2901#define svlogd_full_usage \
2902 "Continuously read log data from standard input, optionally " \
2903 "filter log messages, and write the data to one or more automatically " \
2904 "rotated logs."
2905
2906#define swapoff_trivial_usage \
2907 "[-a] [DEVICE]"
2908#define swapoff_full_usage \
2909 "Stop swapping virtual memory pages on DEVICE.\n\n" \
2910 "Options:\n" \
2911 " -a Stop swapping on all swap devices"
2912
2913#define swapon_trivial_usage \
2914 "[-a] [DEVICE]"
2915#define swapon_full_usage \
2916 "Start swapping virtual memory pages on DEVICE.\n\n" \
2917 "Options:\n" \
2918 " -a Start swapping on all swap devices"
2919
2920#define switch_root_trivial_usage \
2921 "[-c /dev/console] NEW_ROOT NEW_INIT [ARGUMENTS_TO_INIT]"
2922#define switch_root_full_usage \
2923 "Use from PID 1 under initramfs to free initramfs, chroot to NEW_ROOT,\n" \
2924 "and exec NEW_INIT.\n\n" \
2925 "Options:\n" \
2926 " -c Redirect console to device on new root"
2927
2928#define sync_trivial_usage \
2929 ""
2930#define sync_full_usage \
2931 "Write all buffered filesystem blocks to disk."
2932
2933#define sysctl_trivial_usage \
2934 "[OPTIONS]... [VALUE]..."
2935#define sysctl_full_usage \
2936 "configure kernel parameters at runtime\n\n" \
2937 "Options:\n" \
2938 " -n Use this option to disable printing of the key name when printing values\n" \
2939 " -w Use this option when you want to change a sysctl setting\n" \
2940 " -p Load in sysctl settings from the file specified or /etc/sysctl.conf if none given\n" \
2941 " -a Display all values currently available\n" \
2942 " -A Display all values currently available in table form"
2943#define sysctl_example_usage \
2944 "sysctl [-n] variable ...\n" \
2945 "sysctl [-n] -w variable=value ...\n" \
2946 "sysctl [-n] -a\n" \
2947 "sysctl [-n] -p <file> (default /etc/sysctl.conf)\n" \
2948 "sysctl [-n] -A\n"
2949
2950#define syslogd_trivial_usage \
2951 "[OPTION]..."
2952#define syslogd_full_usage \
2953 "Linux system and kernel logging utility.\n" \
2954 "Note that this version of syslogd ignores /etc/syslog.conf.\n\n" \
2955 "Options:\n" \
2956 " -m MIN Minutes between MARK lines (default=20, 0=off)\n" \
2957 " -n Run as a foreground process\n" \
2958 " -O FILE Use an alternate log file (default=/var/log/messages)\n" \
2959 " -l n Sets the local log level of messages to n\n" \
2960 " -S Make logging output smaller" \
2961 USE_FEATURE_ROTATE_LOGFILE( \
2962 "\n -s SIZE Max size (KB) before rotate (default=200KB, 0=off)\n" \
2963 " -b NUM Number of rotated logs to keep (default=1, max=99, 0=purge)") \
2964 USE_FEATURE_REMOTE_LOG( \
2965 "\n -R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP)\n" \
2966 " -L Log locally and via network logging (default is network only)") \
2967 USE_FEATURE_IPC_SYSLOG( \
2968 "\n -C [size(KiB)] Log to a circular buffer (read the buffer using logread)")
2969#define syslogd_example_usage \
2970 "$ syslogd -R masterlog:514\n" \
2971 "$ syslogd -R 192.168.1.1:601\n"
2972
2973#define tail_trivial_usage \
2974 "[OPTION]... [FILE]..."
2975#define tail_full_usage \
2976 "Print last 10 lines of each FILE to standard output.\n" \
2977 "With more than one FILE, precede each with a header giving the\n" \
2978 "file name. With no FILE, or when FILE is -, read standard input.\n\n" \
2979 "Options:\n" \
2980 USE_FEATURE_FANCY_TAIL(" -c N[kbm] output the last N bytes\n") \
2981 " -n N[kbm] print last N lines instead of last 10\n" \
2982 " -f output data as the file grows" \
2983 USE_FEATURE_FANCY_TAIL( "\n -q never output headers giving file names\n" \
2984 " -s SEC wait SEC seconds between reads with -f\n" \
2985 " -v always output headers giving file names\n\n" \
2986 "If the first character of N (bytes or lines) is a '+', output begins with\n" \
2987 "the Nth item from the start of each file, otherwise, print the last N items\n" \
2988 "in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2)." )
2989#define tail_example_usage \
2990 "$ tail -n 1 /etc/resolv.conf\n" \
2991 "nameserver 10.0.0.1\n"
2992
2993#define tar_trivial_usage \
2994 "-[" USE_FEATURE_TAR_CREATE("c") USE_FEATURE_TAR_GZIP("z") \
2995 USE_FEATURE_TAR_BZIP2("j") USE_FEATURE_TAR_LZMA("a") \
2996 USE_FEATURE_TAR_COMPRESS("Z") "xtvO] " \
2997 USE_FEATURE_TAR_FROM("[-X FILE] ") \
2998 "[-f TARFILE] [-C DIR] [FILE(s)] ..."
2999#define tar_full_usage \
3000 "Create, extract, or list files from a tar file.\n\n" \
3001 "Options:\n" \
3002 USE_FEATURE_TAR_CREATE(" c create\n") \
3003 " x extract\n" \
3004 " t list\n" \
3005 "\nArchive format selection:\n" \
3006 USE_FEATURE_TAR_GZIP(" z Filter the archive through gzip\n") \
3007 USE_FEATURE_TAR_BZIP2(" j Filter the archive through bzip2\n") \
3008 USE_FEATURE_TAR_LZMA(" a Filter the archive through lzma\n") \
3009 USE_FEATURE_TAR_COMPRESS(" Z Filter the archive through compress\n") \
3010 "\nFile selection:\n" \
3011 " f name of TARFILE or \"-\" for stdin\n" \
3012 " O extract to stdout\n" \
3013 USE_FEATURE_TAR_FROM( \
3014 " exclude file to exclude\n" \
3015 " X file with names to exclude\n" \
3016 ) \
3017 " C change to directory DIR before operation\n" \
3018 " v verbosely list files processed"
3019#define tar_example_usage \
3020 "$ zcat /tmp/tarball.tar.gz | tar -xf -\n" \
3021 "$ tar -cf /tmp/tarball.tar /usr/local\n"
3022
3023#define taskset_trivial_usage \
3024 "[OPTIONS] [mask] [pid | command [arg]...]"
3025#define taskset_full_usage \
3026 "Set or get CPU affinity.\n\n" \
3027 "Options:\n" \
3028 " -p operate on an existing PID"
3029#define taskset_example_usage \
3030 "$ taskset 0x7 ./dgemm_test&\n" \
3031 "$ taskset -p 0x1 $!\n" \
3032 "pid 4790's current affinity mask: 7\n" \
3033 "pid 4790's new affinity mask: 1\n" \
3034 "$ taskset 0x7 /bin/sh -c './taskset -p 0x1 $$'\n" \
3035 "pid 6671's current affinity mask: 1\n" \
3036 "pid 6671's new affinity mask: 1\n" \
3037 "$ taskset -p 1\n"
3038 "pid 1's current affinity mask: 3\n"
3039
3040#define tee_trivial_usage \
3041 "[OPTION]... [FILE]..."
3042#define tee_full_usage \
3043 "Copy standard input to each FILE, and also to standard output.\n\n" \
3044 "Options:\n" \
3045 " -a append to the given FILEs, do not overwrite\n" \
3046 " -i ignore interrupt signals (SIGINT)"
3047#define tee_example_usage \
3048 "$ echo \"Hello\" | tee /tmp/foo\n" \
3049 "$ cat /tmp/foo\n" \
3050 "Hello\n"
3051
3052#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
3053#define telnet_trivial_usage \
3054 "[-a] [-l USER] HOST [PORT]"
3055#define telnet_full_usage \
3056 "Telnet is used to establish interactive communication with another\n" \
3057 "computer over a network using the TELNET protocol.\n\n" \
3058 "Options:\n" \
3059 " -a Attempt an automatic login with the USER variable\n" \
3060 " -l USER Attempt an automatic login with the USER argument\n" \
3061 " HOST The official name, alias or the IP address of the\n" \
3062 " remote host.\n" \
3063 " PORT The remote port number to connect to. If it is not\n" \
3064 " specified, the default telnet (23) port is used."
3065#else
3066#define telnet_trivial_usage \
3067 "HOST [PORT]"
3068#define telnet_full_usage \
3069 "Telnet is used to establish interactive communication with another\n" \
3070 "computer over a network using the TELNET protocol."
3071#endif
3072
3073#ifdef CONFIG_FEATURE_TELNETD_STANDALONE
3074#define telnetd_trivial_usage \
3075 "[OPTION]"
3076#define telnetd_full_usage \
3077 "Telnetd listens for incoming TELNET connections on PORT.\n" \
3078 "Options:\n" \
3079 " -p PORT listen for connections on PORT (default 23)\n" \
3080 " -l LOGIN exec LOGIN on connect\n" \
3081 " -f issue_file Display issue_file instead of /etc/issue\n" \
3082 " -F Foreground mode\n" \
3083 " -i Inetd mode"
3084#else
3085#define telnetd_trivial_usage \
3086 "[OPTION]"
3087#define telnetd_full_usage \
3088 "Telnetd uses incoming TELNET connections via inetd.\n" \
3089 "Options:\n" \
3090 " -l LOGIN exec LOGIN on connect\n" \
3091 " -f issue_file Display issue_file instead of /etc/issue"
3092#endif
3093
3094#define test_trivial_usage \
3095 "EXPRESSION\n or [ EXPRESSION ]"
3096#define test_full_usage \
3097 "Checks file types and compares values returning an exit\n" \
3098 "code determined by the value of EXPRESSION."
3099#define test_example_usage \
3100 "$ test 1 -eq 2\n" \
3101 "$ echo $?\n" \
3102 "1\n" \
3103 "$ test 1 -eq 1\n" \
3104 "$ echo $?\n" \
3105 "0\n" \
3106 "$ [ -d /etc ]\n" \
3107 "$ echo $?\n" \
3108 "0\n" \
3109 "$ [ -d /junk ]\n" \
3110 "$ echo $?\n" \
3111 "1\n"
3112
3113#define tftp_trivial_usage \
3114 "[OPTION]... HOST [PORT]"
3115#define tftp_full_usage \
3116 "Transfers a file from/to a tftp server using \"octet\" mode.\n\n" \
3117 "Options:\n" \
3118 " -l FILE Local FILE\n" \
3119 " -r FILE Remote FILE" \
3120 USE_FEATURE_TFTP_GET( \
3121 "\n -g Get file" \
3122 ) \
3123 USE_FEATURE_TFTP_PUT( \
3124 "\n -p Put file" \
3125 ) \
3126 USE_FEATURE_TFTP_BLOCKSIZE( \
3127 "\n -b SIZE Transfer blocks of SIZE octets" \
3128 )
3129#define time_trivial_usage \
3130 "[OPTION]... COMMAND [ARGS...]"
3131#define time_full_usage \
3132 "Runs the program COMMAND with arguments ARGS. When COMMAND finishes,\n" \
3133 "COMMAND's resource usage information is displayed\n\n" \
3134 "Options:\n" \
3135 " -v Displays verbose resource usage information"
3136
3137#define top_trivial_usage \
3138 "[-b] [-n count] [-d seconds]"
3139#define top_full_usage \
3140 "top provides a view of process activity in real time.\n" \
3141 "It reads the status of all processes from /proc each <seconds>\n" \
3142 "and shows the status for however many processes will fit on the screen."
3143
3144#define touch_trivial_usage \
3145 "[-c] FILE [FILE ...]"
3146#define touch_full_usage \
3147 "Update the last-modified date on the given FILE[s].\n\n" \
3148 "Options:\n" \
3149 " -c Do not create any files"
3150#define touch_example_usage \
3151 "$ ls -l /tmp/foo\n" \
3152 "/bin/ls: /tmp/foo: No such file or directory\n" \
3153 "$ touch /tmp/foo\n" \
3154 "$ ls -l /tmp/foo\n" \
3155 "-rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo\n"
3156
3157#define tr_trivial_usage \
3158 "[-cds] STRING1 [STRING2]"
3159#define tr_full_usage \
3160 "Translate, squeeze, and/or delete characters from\n" \
3161 "standard input, writing to standard output.\n\n" \
3162 "Options:\n" \
3163 " -c take complement of STRING1\n" \
3164 " -d delete input characters coded STRING1\n" \
3165 " -s squeeze multiple output characters of STRING2 into one character"
3166#define tr_example_usage \
3167 "$ echo \"gdkkn vnqkc\" | tr [a-y] [b-z]\n" \
3168 "hello world\n"
3169
3170#define traceroute_trivial_usage \
3171 "[-FIldnrv] [-f 1st_ttl] [-m max_ttl] [-p port#] [-q nqueries]\n" \
3172 " [-s src_addr] [-t tos] [-w wait] [-g gateway] [-i iface]\n" \
3173 " [-z pausemsecs] host [data size]"
3174#define traceroute_full_usage \
3175 "trace the route ip packets follow going to \"host\"\n" \
3176 "Options:\n" \
3177 " -F Set the don't fragment bit\n" \
3178 " -I Use ICMP ECHO instead of UDP datagrams\n" \
3179 " -l Display the ttl value of the returned packet\n" \
3180 " -d Set SO_DEBUG options to socket\n" \
3181 " -n Print hop addresses numerically rather than symbolically\n" \
3182 " -r Bypass the normal routing tables and send directly to a host\n" \
3183 " -v Verbose output\n" \
3184 " -m max_ttl Set the max time-to-live (max number of hops)\n" \
3185 " -p port# Set the base UDP port number used in probes\n" \
3186 " (default is 33434)\n" \
3187 " -q nqueries Set the number of probes per 'ttl' to nqueries\n" \
3188 " (default is 3)\n" \
3189 " -s src_addr Use the following IP address as the source address\n" \
3190 " -t tos Set the type-of-service in probe packets to the following value\n" \
3191 " (default 0)\n" \
3192 " -w wait Set the time (in seconds) to wait for a response to a probe\n" \
3193 " (default 3 sec)\n" \
3194 " -g Specify a loose source route gateway (8 maximum)"
3195
3196
3197#define true_trivial_usage \
3198 ""
3199#define true_full_usage \
3200 "Return an exit code of TRUE (0)."
3201#define true_example_usage \
3202 "$ true\n" \
3203 "$ echo $?\n" \
3204 "0\n"
3205
3206#define tty_trivial_usage \
3207 ""
3208#define tty_full_usage \
3209 "Print the file name of the terminal connected to standard input.\n\n" \
3210 "Options:\n" \
3211 " -s print nothing, only return an exit status"
3212#define tty_example_usage \
3213 "$ tty\n" \
3214 "/dev/tty2\n"
3215
3216#define tune2fs_trivial_usage \
3217 "[-c max-mounts-count] [-e errors-behavior] [-g group] " \
3218 "[-i interval[d|m|w]] [-j] [-J journal-options] [-l] [-s sparse-flag] " \
3219 "[-m reserved-blocks-percent] [-o [^]mount-options[,...]] " \
3220 "[-r reserved-blocks-count] [-u user] [-C mount-count] " \
3221 "[-L volume-label] [-M last-mounted-dir] [-O [^]feature[,...]] " \
3222 "[-T last-check-time] [-U UUID] device"
3223#define tune2fs_full_usage \
3224 "Adjust filesystem options on ext[23] filesystems."
3225
3226#define udhcpc_trivial_usage \
3227 "[-Cfbnqtv] [-c CID] [-V VCLS] [-H HOSTNAME] [-i INTERFACE]\n[-p pidfile] [-r IP] [-s script]"
3228#define udhcpc_full_usage \
3229 " -V,--vendorclass=CLASSID Set vendor class identifier\n" \
3230 " -i,--interface=INTERFACE Interface to use (default: eth0)\n" \
3231 " -H,-h,--hostname=HOSTNAME Client hostname\n" \
3232 " -c,--clientid=CLIENTID Set client identifier\n" \
3233 " -C,--clientid-none Suppress default client identifier\n" \
3234 " -p,--pidfile=file Store process ID of daemon in file\n" \
3235 " -r,--request=IP IP address to request (default: none)\n" \
3236 " -s,--script=file Run file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
3237 " -t,--retries=NUM Send up to NUM request packets\n"\
3238 " -f,--foreground Do not fork after getting lease\n" \
3239 " -b,--background Fork to background if lease cannot be immediately negotiated\n" \
3240 " -n,--now Exit with failure if lease cannot be immediately negotiated\n" \
3241 " -q,--quit Quit after obtaining lease\n" \
3242 " -R,--release Release IP on quit\n" \
3243 " -v,--version Display version" \
3244
3245#define udhcpd_trivial_usage \
3246 "[configfile]\n" \
3247
3248#define udhcpd_full_usage \
3249 ""
3250
3251#define umount_trivial_usage \
3252 "[flags] FILESYSTEM|DIRECTORY"
3253#define umount_full_usage \
3254 "Unmount file systems\n" \
3255 "\nFlags:\n" " -a Unmount all file systems" \
3256 USE_FEATURE_MTAB_SUPPORT(" in /etc/mtab\n -n Don't erase /etc/mtab entries") \
3257 "\n -r Try to remount devices as read-only if mount is busy" \
3258 "\n -l Lazy umount (detach filesystem)" \
3259 "\n -f Force umount (i.e., unreachable NFS server)" \
3260 USE_FEATURE_MOUNT_LOOP("\n -D Do not free loop device (if a loop device has been used)")
3261#define umount_example_usage \
3262 "$ umount /dev/hdc1\n"
3263
3264#define uname_trivial_usage \
3265 "[OPTION]..."
3266#define uname_full_usage \
3267 "Print certain system information. With no OPTION, same as -s.\n\n" \
3268 "Options:\n" \
3269 " -a print all information\n" \
3270 " -m the machine (hardware) type\n" \
3271 " -n print the machine's network node hostname\n" \
3272 " -r print the operating system release\n" \
3273 " -s print the operating system name\n" \
3274 " -p print the host processor type\n" \
3275 " -v print the operating system version"
3276#define uname_example_usage \
3277 "$ uname -a\n" \
3278 "Linux debian 2.4.23 #2 Tue Dec 23 17:09:10 MST 2003 i686 GNU/Linux\n"
3279
3280#define uncompress_trivial_usage \
3281 "[-c] [-f] [ name ... ]"
3282#define uncompress_full_usage \
3283 "Uncompress .Z file[s]\n" \
3284 "Options:\n" \
3285 " -c extract to stdout\n" \
3286 " -f force overwrite an existing file"
3287
3288#define uniq_trivial_usage \
3289 "[-fscdu]... [INPUT [OUTPUT]]"
3290#define uniq_full_usage \
3291 "Discard all but one of successive identical lines from INPUT\n" \
3292 "(or standard input), writing to OUTPUT (or standard output).\n\n" \
3293 "Options:\n" \
3294 " -c prefix lines by the number of occurrences\n" \
3295 " -d only print duplicate lines\n" \
3296 " -u only print unique lines\n" \
3297 " -f N skip the first N fields\n" \
3298 " -s N skip the first N chars (after any skipped fields)"
3299#define uniq_example_usage \
3300 "$ echo -e \"a\\na\\nb\\nc\\nc\\na\" | sort | uniq\n" \
3301 "a\n" \
3302 "b\n" \
3303 "c\n"
3304
3305#define unix2dos_trivial_usage \
3306 "[option] [FILE]"
3307#define unix2dos_full_usage \
3308 "Converts FILE from unix format to dos format. When no option\n" \
3309 "is given, the input is converted to the opposite output format.\n" \
3310 "When no file is given, uses stdin for input and stdout for output.\n" \
3311 "Options:\n" \
3312 " -u output will be in UNIX format\n" \
3313 " -d output will be in DOS format"
3314
3315#define unzip_trivial_usage \
3316 "[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]"
3317#define unzip_full_usage \
3318 "Extracts files from ZIP archives.\n\n" \
3319 "Options:\n" \
3320 " -l list archive contents (short form)\n" \
3321 " -n never overwrite existing files (default)\n" \
3322 " -o overwrite files without prompting\n" \
3323 " -p send output to stdout\n" \
3324 " -q be quiet\n" \
3325 " -x exclude these files\n" \
3326 " -d extract files into this directory"
3327
3328#define uptime_trivial_usage \
3329 ""
3330#define uptime_full_usage \
3331 "Display the time since the last boot."
3332#define uptime_example_usage \
3333 "$ uptime\n" \
3334 " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n"
3335
3336#define usleep_trivial_usage \
3337 "N"
3338#define usleep_full_usage \
3339 "Pause for N microseconds."
3340#define usleep_example_usage \
3341 "$ usleep 1000000\n" \
3342 "[pauses for 1 second]\n"
3343
3344#define uudecode_trivial_usage \
3345 "[FILE]..."
3346#define uudecode_full_usage \
3347 "Uudecode a file that is uuencoded.\n\n" \
3348 "Options:\n" \
3349 " -o FILE direct output to FILE"
3350#define uudecode_example_usage \
3351 "$ uudecode -o busybox busybox.uu\n" \
3352 "$ ls -l busybox\n" \
3353 "-rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox\n"
3354
3355#define uuencode_trivial_usage \
3356 "[OPTION] [INFILE] REMOTEFILE"
3357#define uuencode_full_usage \
3358 "Uuencode a file.\n\n" \
3359 "Options:\n" \
3360 " -m use base64 encoding per RFC1521"
3361#define uuencode_example_usage \
3362 "$ uuencode busybox busybox\n" \
3363 "begin 755 busybox\n" \
3364 "<encoded file snipped>\n" \
3365 "$ uudecode busybox busybox > busybox.uu\n" \
3366 "$\n"
3367
3368#define vconfig_trivial_usage \
3369 "COMMAND [OPTIONS] ..."
3370#define vconfig_full_usage \
3371 "vconfig lets you create and remove virtual ethernet devices.\n\n" \
3372 "Options:\n" \
3373 " add [interface-name] [vlan_id]\n" \
3374 " rem [vlan-name]\n" \
3375 " set_flag [interface-name] [flag-num] [0 | 1]\n" \
3376 " set_egress_map [vlan-name] [skb_priority] [vlan_qos]\n" \
3377 " set_ingress_map [vlan-name] [skb_priority] [vlan_qos]\n" \
3378 " set_name_type [name-type]"
3379
3380#define vi_trivial_usage \
3381 "[OPTION] [FILE]..."
3382#define vi_full_usage \
3383 "edit FILE.\n\n" \
3384 "Options:\n" \
3385 " -R Read-only- do not write to the file"
3386
3387#define vlock_trivial_usage \
3388 "[OPTIONS]"
3389#define vlock_full_usage \
3390 "Lock a virtual terminal. A password is required to unlock\n" \
3391 "Options:\n" \
3392 " -a Lock all VTs"
3393
3394#define watch_trivial_usage \
3395 "[-n <seconds>] [-t] COMMAND..."
3396#define watch_full_usage \
3397 "Executes a program periodically\n\n" \
3398 "Options:\n" \
3399 " -n Loop period in seconds - default is 2\n"
3400 " -t Don't print header"
3401#define watch_example_usage \
3402 "$ watch date\n" \
3403 "Mon Dec 17 10:31:40 GMT 2000\n" \
3404 "Mon Dec 17 10:31:42 GMT 2000\n" \
3405 "Mon Dec 17 10:31:44 GMT 2000"
3406
3407#define watchdog_trivial_usage \
3408 "[-t <seconds>] [-F] DEV"
3409#define watchdog_full_usage \
3410 "Periodically write to watchdog device DEV.\n" \
3411 "Options:\n" \
3412 " -t Timer period in seconds - default is 30\n" \
3413 " -F Stay in the foreground and don't fork"
3414
3415#define wc_trivial_usage \
3416 "[OPTION]... [FILE]..."
3417#define wc_full_usage \
3418 "Print line, word, and byte counts for each FILE, and a total line if\n" \
3419 "more than one FILE is specified. With no FILE, read standard input.\n\n" \
3420 "Options:\n" \
3421 " -c print the byte counts\n" \
3422 " -l print the newline counts\n" \
3423 " -L print the length of the longest line\n" \
3424 " -w print the word counts"
3425#define wc_example_usage \
3426 "$ wc /etc/passwd\n" \
3427 " 31 46 1365 /etc/passwd\n"
3428
3429#define wget_trivial_usage \
3430 "[-c|--continue] [-q|--quiet] [-O|--output-document file]\n" \
3431 " [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]\n" \
3432 " [-U|--user-agent agent] url"
3433#define wget_full_usage \
3434 "wget retrieves files via HTTP or FTP\n\n" \
3435 "Options:\n" \
3436 " -c continue retrieval of aborted transfers\n" \
3437 " -q quiet mode - do not print\n" \
3438 " -P Set directory prefix to DIR\n" \
3439 " -O save to filename ('-' for stdout)\n" \
3440 " -U adjust 'User-Agent' field\n" \
3441 " -Y use proxy ('on' or 'off')"
3442
3443#define which_trivial_usage \
3444 "[COMMAND ...]"
3445#define which_full_usage \
3446 "Locates a COMMAND."
3447#define which_example_usage \
3448 "$ which login\n" \
3449 "/bin/login\n"
3450
3451#define who_trivial_usage \
3452 " "
3453#define who_full_usage \
3454 "Prints the current user names and related information"
3455
3456#define whoami_trivial_usage \
3457 ""
3458#define whoami_full_usage \
3459 "Prints the user name associated with the current effective user id."
3460
3461#define xargs_trivial_usage \
3462 "[OPTIONS] [COMMAND] [ARGS...]"
3463#define xargs_full_usage \
3464 "Executes COMMAND on every item given by standard input.\n\n" \
3465 "Options:\n" \
3466 USE_FEATURE_XARGS_SUPPORT_CONFIRMATION(" -p Prompt the user about whether to run each command\n") \
3467 " -r Do not run command for empty read lines\n" \
3468 USE_FEATURE_XARGS_SUPPORT_TERMOPT(" -x Exit if the size is exceeded\n") \
3469 USE_FEATURE_XARGS_SUPPORT_ZERO_TERM(" -0 Input filenames are terminated by a null character\n") \
3470 " -t Print the command line on stderr before executing it"
3471#define xargs_example_usage \
3472 "$ ls | xargs gzip\n" \
3473 "$ find . -name '*.c' -print | xargs rm\n"
3474
3475#define yes_trivial_usage \
3476 "[OPTION]... [STRING]..."
3477#define yes_full_usage \
3478 "Repeatedly outputs a line with all specified STRING(s), or 'y'."
3479
3480#define zcat_trivial_usage \
3481 "FILE"
3482#define zcat_full_usage \
3483 "Uncompress to stdout."
3484
3485#define zcip_trivial_usage \
3486 "[OPTIONS] ifname script"
3487#define zcip_full_usage \
3488 "zcip manages a ZeroConf IPv4 link-local address.\n" \
3489 "Options:\n" \
3490 " -f foreground mode\n" \
3491 " -q quit after address (no daemon)\n" \
3492 " -r 169.254.x.x request this address first\n" \
3493 " -v verbose"
3494
3495#endif /* __BB_USAGE_H__ */
diff --git a/include/xatonum.h b/include/xatonum.h
new file mode 100644
index 000000000..585d84623
--- /dev/null
+++ b/include/xatonum.h
@@ -0,0 +1,157 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * ascii-to-numbers implementations for busybox
4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 *
7 * Licensed under GPLv2, see file LICENSE in this tarball for details.
8 */
9
10/* Provides extern declarations of functions */
11#define DECLARE_STR_CONV(type, T, UT) \
12\
13unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \
14unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u); \
15unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx); \
16unsigned type xstrto##UT(const char *str, int b); \
17unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \
18unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u); \
19unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx); \
20unsigned type xato##UT(const char *str); \
21type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx) ;\
22type xstrto##T##_range(const char *str, int b, type l, type u); \
23type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx); \
24type xato##T##_range(const char *str, type l, type u); \
25type xato##T##_sfx(const char *str, const struct suffix_mult *sfx); \
26type xato##T(const char *str); \
27
28/* Unsigned long long functions always exist */
29DECLARE_STR_CONV(long long, ll, ull)
30
31
32/* Provides extern inline definitions of functions */
33/* (useful for mapping them to the type of the same width) */
34#define DEFINE_EQUIV_STR_CONV(narrow, N, W, UN, UW) \
35\
36extern inline \
37unsigned narrow xstrto##UN##_range_sfx(const char *str, int b, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \
38{ return xstrto##UW##_range_sfx(str, b, l, u, sfx); } \
39extern inline \
40unsigned narrow xstrto##UN##_range(const char *str, int b, unsigned narrow l, unsigned narrow u) \
41{ return xstrto##UW##_range(str, b, l, u); } \
42extern inline \
43unsigned narrow xstrto##UN##_sfx(const char *str, int b, const struct suffix_mult *sfx) \
44{ return xstrto##UW##_sfx(str, b, sfx); } \
45extern inline \
46unsigned narrow xstrto##UN(const char *str, int b) \
47{ return xstrto##UW(str, b); } \
48extern inline \
49unsigned narrow xato##UN##_range_sfx(const char *str, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \
50{ return xato##UW##_range_sfx(str, l, u, sfx); } \
51extern inline \
52unsigned narrow xato##UN##_range(const char *str, unsigned narrow l, unsigned narrow u) \
53{ return xato##UW##_range(str, l, u); } \
54extern inline \
55unsigned narrow xato##UN##_sfx(const char *str, const struct suffix_mult *sfx) \
56{ return xato##UW##_sfx(str, sfx); } \
57extern inline \
58unsigned narrow xato##UN(const char *str) \
59{ return xato##UW(str); } \
60extern inline \
61narrow xstrto##N##_range_sfx(const char *str, int b, narrow l, narrow u, const struct suffix_mult *sfx) \
62{ return xstrto##W##_range_sfx(str, b, l, u, sfx); } \
63extern inline \
64narrow xstrto##N##_range(const char *str, int b, narrow l, narrow u) \
65{ return xstrto##W##_range(str, b, l, u); } \
66extern inline \
67narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \
68{ return xato##W##_range_sfx(str, l, u, sfx); } \
69extern inline \
70narrow xato##N##_range(const char *str, narrow l, narrow u) \
71{ return xato##W##_range(str, l, u); } \
72extern inline \
73narrow xato##N##_sfx(const char *str, const struct suffix_mult *sfx) \
74{ return xato##W##_sfx(str, sfx); } \
75extern inline \
76narrow xato##N(const char *str) \
77{ return xato##W(str); } \
78
79/* If long == long long, then just map them one-to-one */
80#if ULONG_MAX == ULLONG_MAX
81DEFINE_EQUIV_STR_CONV(long, l, ll, ul, ull)
82#else
83/* Else provide extern defs */
84DECLARE_STR_CONV(long, l, ul)
85#endif
86
87/* Same for int -> [long] long */
88#if UINT_MAX == ULLONG_MAX
89DEFINE_EQUIV_STR_CONV(int, i, ll, u, ull)
90#elif UINT_MAX == ULONG_MAX
91DEFINE_EQUIV_STR_CONV(int, i, l, u, ul)
92#else
93DECLARE_STR_CONV(int, i, u)
94#endif
95
96/* Specialized */
97
98int BUG_xatou32_unimplemented(void);
99extern inline uint32_t xatou32(const char *numstr)
100{
101 if (UINT_MAX == 0xffffffff)
102 return xatou(numstr);
103 if (ULONG_MAX == 0xffffffff)
104 return xatoul(numstr);
105 return BUG_xatou32_unimplemented();
106}
107
108/* Non-aborting kind of convertors */
109
110unsigned long long bb_strtoull(const char *arg, char **endp, int base);
111long long bb_strtoll(const char *arg, char **endp, int base);
112
113#if ULONG_MAX == ULLONG_MAX
114extern inline
115unsigned long bb_strtoul(const char *arg, char **endp, int base)
116{ return bb_strtoull(arg, endp, base); }
117extern inline
118unsigned long bb_strtol(const char *arg, char **endp, int base)
119{ return bb_strtoll(arg, endp, base); }
120#else
121unsigned long bb_strtoul(const char *arg, char **endp, int base);
122long bb_strtol(const char *arg, char **endp, int base);
123#endif
124
125#if UINT_MAX == ULLONG_MAX
126extern inline
127unsigned long bb_strtou(const char *arg, char **endp, int base)
128{ return bb_strtoull(arg, endp, base); }
129extern inline
130unsigned long bb_strtoi(const char *arg, char **endp, int base)
131{ return bb_strtoll(arg, endp, base); }
132#elif UINT_MAX == ULONG_MAX
133extern inline
134unsigned long bb_strtou(const char *arg, char **endp, int base)
135{ return bb_strtoul(arg, endp, base); }
136extern inline
137unsigned long bb_strtoi(const char *arg, char **endp, int base)
138{ return bb_strtol(arg, endp, base); }
139#else
140unsigned long bb_strtou(const char *arg, char **endp, int base);
141long bb_strtoi(const char *arg, char **endp, int base);
142#endif
143
144int BUG_bb_strtou32_unimplemented(void);
145extern inline
146uint32_t bb_strtou32(const char *arg, char **endp, int base)
147{
148 if (sizeof(uint32_t) == sizeof(unsigned))
149 return bb_strtou(arg, endp, base);
150 if (sizeof(uint32_t) == sizeof(unsigned long))
151 return bb_strtoul(arg, endp, base);
152 return BUG_bb_strtou32_unimplemented();
153}
154
155/* Floating point */
156
157/* double bb_strtod(const char *arg, char **endp); */
diff --git a/include/xregex.h b/include/xregex.h
new file mode 100644
index 000000000..4185818a8
--- /dev/null
+++ b/include/xregex.h
@@ -0,0 +1,17 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * Busybox xregcomp utility routine. This isn't in libbb.h because the
4 * C library we're linking against may not support regex.h.
5 *
6 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
7 * Permission has been granted to redistribute this code under the GPL.
8 *
9 * Licensed under GPLv2 or later, see file License in this tarball for details.
10 */
11#ifndef __BB_REGEX__
12#define __BB_REGEX__
13
14#include <regex.h>
15extern void xregcomp(regex_t *preg, const char *regex, int cflags);
16
17#endif