aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-11-23 06:23:44 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-11-23 06:23:44 +0100
commitf8f81ed7aaf90897fa9a4687dac75152740a71e2 (patch)
treea5c624d8187016e4369be0be2667a2f5de752d03
parentf88e3bfa8ded4f1c7e7d2143a1cfcbbdfe5e8541 (diff)
downloadbusybox-w32-f8f81ed7aaf90897fa9a4687dac75152740a71e2.tar.gz
busybox-w32-f8f81ed7aaf90897fa9a4687dac75152740a71e2.tar.bz2
busybox-w32-f8f81ed7aaf90897fa9a4687dac75152740a71e2.zip
Convert all procps/* applets to "new style" applet definitions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/applets.src.h14
-rw-r--r--procps/Config.src140
-rw-r--r--procps/Kbuild.src15
-rw-r--r--procps/free.c12
-rw-r--r--procps/fuser.c11
-rw-r--r--procps/kill.c30
-rw-r--r--procps/pgrep.c17
-rw-r--r--procps/pidof.c26
-rw-r--r--procps/ps.c49
-rw-r--r--procps/renice.c10
-rw-r--r--procps/sysctl.c9
-rw-r--r--procps/top.c5
-rw-r--r--procps/uptime.c7
-rw-r--r--procps/watch.c11
14 files changed, 184 insertions, 172 deletions
diff --git a/include/applets.src.h b/include/applets.src.h
index 5eaa5cbb8..1d2d9c8ed 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -124,7 +124,6 @@ IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP))
124IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) 124IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE))
125IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) 125IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP))
126IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) 126IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold))
127IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP))
128IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) 127IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP))
129//IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) 128//IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2))
130//IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) 129//IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3))
@@ -133,7 +132,6 @@ IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync))
133IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) 132IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
134IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget)) 133IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget))
135IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput)) 134IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput))
136IF_FUSER(APPLET(fuser, BB_DIR_USR_BIN, BB_SUID_DROP))
137IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) 135IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP))
138IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) 136IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP))
139IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) 137IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP))
@@ -163,9 +161,6 @@ IF_IPROUTE(APPLET(iproute, BB_DIR_SBIN, BB_SUID_DROP))
163IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP)) 161IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP))
164IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP)) 162IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP))
165IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) 163IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP))
166IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP))
167IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall))
168IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_SBIN, BB_SUID_DROP, killall5))
169//IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) 164//IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length))
170IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) 165IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln))
171IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) 166IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
@@ -201,14 +196,10 @@ IF_NTPD(APPLET(ntpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
201IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) 196IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP))
202IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP)) 197IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP))
203//IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) 198//IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP))
204IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP))
205IF_PIDOF(APPLET(pidof, BB_DIR_BIN, BB_SUID_DROP))
206IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) 199IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP))
207IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill))
208IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) 200IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP))
209IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) 201IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv))
210IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) 202IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf))
211IF_PS(APPLET(ps, BB_DIR_BIN, BB_SUID_DROP))
212IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP)) 203IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP))
213IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) 204IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd))
214IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) 205IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP))
@@ -217,7 +208,6 @@ IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP))
217IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) 208IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP))
218IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) 209IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP))
219IF_REFORMIME(APPLET(reformime, BB_DIR_BIN, BB_SUID_DROP)) 210IF_REFORMIME(APPLET(reformime, BB_DIR_BIN, BB_SUID_DROP))
220IF_RENICE(APPLET(renice, BB_DIR_USR_BIN, BB_SUID_DROP))
221IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) 211IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP))
222IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) 212IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP))
223IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) 213IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon))
@@ -249,7 +239,6 @@ IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP))
249IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) 239IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP))
250IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) 240IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP))
251IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) 241IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP))
252IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP))
253IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) 242IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac))
254IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) 243IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP))
255/* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */ 244/* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */
@@ -262,7 +251,6 @@ IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test))
262IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) 251IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP))
263IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) 252IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
264#endif 253#endif
265IF_TOP(APPLET(top, BB_DIR_USR_BIN, BB_SUID_DROP))
266IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) 254IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP))
267/* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ 255/* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */
268IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) 256IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE))
@@ -278,12 +266,10 @@ IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP))
278IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) 266IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand))
279IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) 267IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP))
280IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) 268IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos))
281IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP))
282IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) 269IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep))
283IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) 270IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP))
284IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) 271IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP))
285IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP)) 272IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP))
286IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP))
287IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) 273IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP))
288IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) 274IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami))
289IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) 275IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes))
diff --git a/procps/Config.src b/procps/Config.src
index 527d9ee0c..eb4760752 100644
--- a/procps/Config.src
+++ b/procps/Config.src
@@ -7,139 +7,6 @@ menu "Process Utilities"
7 7
8INSERT 8INSERT
9 9
10config FREE
11 bool "free"
12 default y
13 select PLATFORM_LINUX #sysinfo()
14 help
15 free displays the total amount of free and used physical and swap
16 memory in the system, as well as the buffers used by the kernel.
17 The shared memory column should be ignored; it is obsolete.
18
19config FUSER
20 bool "fuser"
21 default y
22 help
23 fuser lists all PIDs (Process IDs) that currently have a given
24 file open. fuser can also list all PIDs that have a given network
25 (TCP or UDP) port open.
26
27config KILL
28 bool "kill"
29 default y
30 help
31 The command kill sends the specified signal to the specified
32 process or process group. If no signal is specified, the TERM
33 signal is sent.
34
35config KILLALL
36 bool "killall"
37 default y
38 depends on KILL
39 help
40 killall sends a signal to all processes running any of the
41 specified commands. If no signal name is specified, SIGTERM is
42 sent.
43
44config KILLALL5
45 bool "killall5"
46 default y
47 depends on KILL
48
49config PGREP
50 bool "pgrep"
51 default y
52 help
53 Look for processes by name.
54
55config PIDOF
56 bool "pidof"
57 default y
58 help
59 Pidof finds the process id's (pids) of the named programs. It prints
60 those id's on the standard output.
61
62config FEATURE_PIDOF_SINGLE
63 bool "Enable argument for single shot (-s)"
64 default y
65 depends on PIDOF
66 help
67 Support argument '-s' for returning only the first pid found.
68
69config FEATURE_PIDOF_OMIT
70 bool "Enable argument for omitting pids (-o)"
71 default y
72 depends on PIDOF
73 help
74 Support argument '-o' for omitting the given pids in output.
75 The special pid %PPID can be used to name the parent process
76 of the pidof, in other words the calling shell or shell script.
77
78config PKILL
79 bool "pkill"
80 default y
81 help
82 Send signals to processes by name.
83
84config PS
85 bool "ps"
86 default y
87 help
88 ps gives a snapshot of the current processes.
89
90config FEATURE_PS_WIDE
91 bool "Enable wide output option (-w)"
92 default y
93 depends on PS && !DESKTOP
94 help
95 Support argument 'w' for wide output.
96 If given once, 132 chars are printed, and if given more
97 than once, the length is unlimited.
98
99config FEATURE_PS_LONG
100 bool "Enable long output option (-l)"
101 default y
102 depends on PS && !DESKTOP
103 help
104 Support argument 'l' for long output.
105 Adds fields PPID, RSS, START, TIME & TTY
106
107config FEATURE_PS_TIME
108 bool "Enable time and elapsed time output"
109 default y
110 depends on PS && DESKTOP
111 select PLATFORM_LINUX
112 help
113 Support -o time and -o etime output specifiers.
114
115config FEATURE_PS_ADDITIONAL_COLUMNS
116 bool "Enable additional ps columns"
117 default y
118 depends on PS && DESKTOP
119 help
120 Support -o rgroup, -o ruser, -o nice output specifiers.
121
122config FEATURE_PS_UNUSUAL_SYSTEMS
123 bool "Support Linux prior to 2.4.0 and non-ELF systems"
124 default n
125 depends on FEATURE_PS_TIME
126 help
127 Include support for measuring HZ on old kernels and non-ELF systems
128 (if you are on Linux 2.4.0+ and use ELF, you don't need this)
129
130config RENICE
131 bool "renice"
132 default y
133 help
134 Renice alters the scheduling priority of one or more running
135 processes.
136
137config BB_SYSCTL
138 bool "sysctl"
139 default y
140 help
141 Configure kernel parameters at runtime.
142
143config FEATURE_SHOW_THREADS 10config FEATURE_SHOW_THREADS
144 bool "Support for showing threads in ps/pstree/top" 11 bool "Support for showing threads in ps/pstree/top"
145 default y 12 default y
@@ -148,11 +15,4 @@ config FEATURE_SHOW_THREADS
148 Enables the ps -T option, showing of threads in pstree, 15 Enables the ps -T option, showing of threads in pstree,
149 and 'h' command in top. 16 and 'h' command in top.
150 17
151config WATCH
152 bool "watch"
153 default y
154 help
155 watch is used to execute a program periodically, showing
156 output to the screen.
157
158endmenu 18endmenu
diff --git a/procps/Kbuild.src b/procps/Kbuild.src
index 89b1cc094..83af05a05 100644
--- a/procps/Kbuild.src
+++ b/procps/Kbuild.src
@@ -7,16 +7,5 @@
7lib-y:= 7lib-y:=
8 8
9INSERT 9INSERT
10lib-$(CONFIG_FREE) += free.o 10
11lib-$(CONFIG_FUSER) += fuser.o 11lib-$(CONFIG_ASH) += kill.o # used for built-in kill by ash
12lib-$(CONFIG_KILL) += kill.o
13lib-$(CONFIG_ASH) += kill.o # used for built-in kill by ash
14lib-$(CONFIG_PGREP) += pgrep.o
15lib-$(CONFIG_PKILL) += pgrep.o
16lib-$(CONFIG_PIDOF) += pidof.o
17lib-$(CONFIG_PS) += ps.o
18lib-$(CONFIG_RENICE) += renice.o
19lib-$(CONFIG_BB_SYSCTL) += sysctl.o
20lib-$(CONFIG_TOP) += top.o
21lib-$(CONFIG_UPTIME) += uptime.o
22lib-$(CONFIG_WATCH) += watch.o
diff --git a/procps/free.c b/procps/free.c
index fca9a2242..f3a2c3c0c 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -6,8 +6,18 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9//config:config FREE
10//config: bool "free"
11//config: default y
12//config: select PLATFORM_LINUX #sysinfo()
13//config: help
14//config: free displays the total amount of free and used physical and swap
15//config: memory in the system, as well as the buffers used by the kernel.
16//config: The shared memory column should be ignored; it is obsolete.
9 17
10/* getopt not needed */ 18//applet:IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP))
19
20//kbuild:lib-$(CONFIG_FREE) += free.o
11 21
12//usage:#define free_trivial_usage 22//usage:#define free_trivial_usage
13//usage: "" IF_DESKTOP("[-b/k/m/g]") 23//usage: "" IF_DESKTOP("[-b/k/m/g]")
diff --git a/procps/fuser.c b/procps/fuser.c
index 6dac852ed..db28cca79 100644
--- a/procps/fuser.c
+++ b/procps/fuser.c
@@ -6,6 +6,17 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9//config:config FUSER
10//config: bool "fuser"
11//config: default y
12//config: help
13//config: fuser lists all PIDs (Process IDs) that currently have a given
14//config: file open. fuser can also list all PIDs that have a given network
15//config: (TCP or UDP) port open.
16
17//applet:IF_FUSER(APPLET(fuser, BB_DIR_USR_BIN, BB_SUID_DROP))
18
19//kbuild:lib-$(CONFIG_FUSER) += fuser.o
9 20
10//usage:#define fuser_trivial_usage 21//usage:#define fuser_trivial_usage
11//usage: "[OPTIONS] FILE or PORT/PROTO" 22//usage: "[OPTIONS] FILE or PORT/PROTO"
diff --git a/procps/kill.c b/procps/kill.c
index c5c7a8d72..1ee79a051 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -7,6 +7,36 @@
7 * 7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10//config:config KILL
11//config: bool "kill"
12//config: default y
13//config: help
14//config: The command kill sends the specified signal to the specified
15//config: process or process group. If no signal is specified, the TERM
16//config: signal is sent.
17//config:
18//config:config KILLALL
19//config: bool "killall"
20//config: default y
21//config: depends on KILL
22//config: help
23//config: killall sends a signal to all processes running any of the
24//config: specified commands. If no signal name is specified, SIGTERM is
25//config: sent.
26//config:
27//config:config KILLALL5
28//config: bool "killall5"
29//config: default y
30//config: depends on KILL
31//config:
32
33//applet:IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP))
34//applet:IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall))
35//applet:IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_SBIN, BB_SUID_DROP, killall5))
36
37//kbuild:lib-$(CONFIG_KILL) += kill.o
38//kbuild:lib-$(CONFIG_KILLALL) += kill.o
39//kbuild:lib-$(CONFIG_KILLALL5) += kill.o
10 40
11//usage:#define kill_trivial_usage 41//usage:#define kill_trivial_usage
12//usage: "[-l] [-SIG] PID..." 42//usage: "[-l] [-SIG] PID..."
diff --git a/procps/pgrep.c b/procps/pgrep.c
index 1c594cf96..974d007f3 100644
--- a/procps/pgrep.c
+++ b/procps/pgrep.c
@@ -6,6 +6,23 @@
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9//config:config PGREP
10//config: bool "pgrep"
11//config: default y
12//config: help
13//config: Look for processes by name.
14//config:
15//config:config PKILL
16//config: bool "pkill"
17//config: default y
18//config: help
19//config: Send signals to processes by name.
20
21//applet:IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP))
22//applet:IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill))
23
24//kbuild:lib-$(CONFIG_PGREP) += pgrep.o
25//kbuild:lib-$(CONFIG_PKILL) += pgrep.o
9 26
10//usage:#define pgrep_trivial_usage 27//usage:#define pgrep_trivial_usage
11//usage: "[-flnovx] [-s SID|-P PPID|PATTERN]" 28//usage: "[-flnovx] [-s SID|-P PPID|PATTERN]"
diff --git a/procps/pidof.c b/procps/pidof.c
index 6d265667f..069adb7a4 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -6,6 +6,32 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9//config:config PIDOF
10//config: bool "pidof"
11//config: default y
12//config: help
13//config: Pidof finds the process id's (pids) of the named programs. It prints
14//config: those id's on the standard output.
15//config:
16//config:config FEATURE_PIDOF_SINGLE
17//config: bool "Enable argument for single shot (-s)"
18//config: default y
19//config: depends on PIDOF
20//config: help
21//config: Support argument '-s' for returning only the first pid found.
22//config:
23//config:config FEATURE_PIDOF_OMIT
24//config: bool "Enable argument for omitting pids (-o)"
25//config: default y
26//config: depends on PIDOF
27//config: help
28//config: Support argument '-o' for omitting the given pids in output.
29//config: The special pid %PPID can be used to name the parent process
30//config: of the pidof, in other words the calling shell or shell script.
31
32//applet:IF_PIDOF(APPLET(pidof, BB_DIR_BIN, BB_SUID_DROP))
33
34//kbuild:lib-$(CONFIG_PIDOF) += pidof.o
9 35
10//usage:#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT) 36//usage:#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT)
11//usage:#define pidof_trivial_usage 37//usage:#define pidof_trivial_usage
diff --git a/procps/ps.c b/procps/ps.c
index ce638261a..e291ecd7e 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -8,6 +8,55 @@
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11//config:config PS
12//config: bool "ps"
13//config: default y
14//config: help
15//config: ps gives a snapshot of the current processes.
16//config:
17//config:config FEATURE_PS_WIDE
18//config: bool "Enable wide output option (-w)"
19//config: default y
20//config: depends on PS && !DESKTOP
21//config: help
22//config: Support argument 'w' for wide output.
23//config: If given once, 132 chars are printed, and if given more
24//config: than once, the length is unlimited.
25//config:
26//config:config FEATURE_PS_LONG
27//config: bool "Enable long output option (-l)"
28//config: default y
29//config: depends on PS && !DESKTOP
30//config: help
31//config: Support argument 'l' for long output.
32//config: Adds fields PPID, RSS, START, TIME & TTY
33//config:
34//config:config FEATURE_PS_TIME
35//config: bool "Enable time and elapsed time output"
36//config: default y
37//config: depends on PS && DESKTOP
38//config: select PLATFORM_LINUX
39//config: help
40//config: Support -o time and -o etime output specifiers.
41//config:
42//config:config FEATURE_PS_ADDITIONAL_COLUMNS
43//config: bool "Enable additional ps columns"
44//config: default y
45//config: depends on PS && DESKTOP
46//config: help
47//config: Support -o rgroup, -o ruser, -o nice output specifiers.
48//config:
49//config:config FEATURE_PS_UNUSUAL_SYSTEMS
50//config: bool "Support Linux prior to 2.4.0 and non-ELF systems"
51//config: default n
52//config: depends on FEATURE_PS_TIME
53//config: help
54//config: Include support for measuring HZ on old kernels and non-ELF systems
55//config: (if you are on Linux 2.4.0+ and use ELF, you don't need this)
56
57//applet:IF_PS(APPLET(ps, BB_DIR_BIN, BB_SUID_DROP))
58
59//kbuild:lib-$(CONFIG_PS) += ps.o
11 60
12//usage:#if ENABLE_DESKTOP 61//usage:#if ENABLE_DESKTOP
13//usage: 62//usage:
diff --git a/procps/renice.c b/procps/renice.c
index 2b690e0ed..64213c680 100644
--- a/procps/renice.c
+++ b/procps/renice.c
@@ -18,6 +18,16 @@
18 * options -p, -g, and -u are treated as mode switches for the 18 * options -p, -g, and -u are treated as mode switches for the
19 * following IDs (if any). Multiple switches are allowed. 19 * following IDs (if any). Multiple switches are allowed.
20 */ 20 */
21//config:config RENICE
22//config: bool "renice"
23//config: default y
24//config: help
25//config: Renice alters the scheduling priority of one or more running
26//config: processes.
27
28//applet:IF_RENICE(APPLET(renice, BB_DIR_USR_BIN, BB_SUID_DROP))
29
30//kbuild:lib-$(CONFIG_RENICE) += renice.o
21 31
22//usage:#define renice_trivial_usage 32//usage:#define renice_trivial_usage
23//usage: "[-n] PRIORITY [[-p | -g | -u] ID...]..." 33//usage: "[-n] PRIORITY [[-p | -g | -u] ID...]..."
diff --git a/procps/sysctl.c b/procps/sysctl.c
index f0883f054..93d7c3418 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -10,6 +10,15 @@
10 * v1.01 - added -p <preload> to preload values from a file 10 * v1.01 - added -p <preload> to preload values from a file
11 * v1.01.1 - busybox applet aware by <solar@gentoo.org> 11 * v1.01.1 - busybox applet aware by <solar@gentoo.org>
12 */ 12 */
13//config:config BB_SYSCTL
14//config: bool "sysctl"
15//config: default y
16//config: help
17//config: Configure kernel parameters at runtime.
18
19//applet:IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP))
20
21//kbuild:lib-$(CONFIG_BB_SYSCTL) += sysctl.o
13 22
14//usage:#define sysctl_trivial_usage 23//usage:#define sysctl_trivial_usage
15//usage: "[OPTIONS] [KEY[=VALUE]]..." 24//usage: "[OPTIONS] [KEY[=VALUE]]..."
diff --git a/procps/top.c b/procps/top.c
index 6f7f7d382..c66cdb764 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -49,7 +49,6 @@
49 * cp stat meminfo loadavg proc 49 * cp stat meminfo loadavg proc
50 * chroot . ./top -bn1 >top1.out 50 * chroot . ./top -bn1 >top1.out
51 */ 51 */
52
53//config:config TOP 52//config:config TOP
54//config: bool "top" 53//config: bool "top"
55//config: default y 54//config: default y
@@ -104,6 +103,10 @@
104//config: help 103//config: help
105//config: Enable 's' in top (gives lots of memory info). 104//config: Enable 's' in top (gives lots of memory info).
106 105
106//applet:IF_TOP(APPLET(top, BB_DIR_USR_BIN, BB_SUID_DROP))
107
108//kbuild:lib-$(CONFIG_TOP) += top.o
109
107#include "libbb.h" 110#include "libbb.h"
108#include "common_bufsiz.h" 111#include "common_bufsiz.h"
109 112
diff --git a/procps/uptime.c b/procps/uptime.c
index 149bae6e5..436193925 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -11,9 +11,6 @@
11 * 11 *
12 * Added FEATURE_UPTIME_UTMP_SUPPORT flag. 12 * Added FEATURE_UPTIME_UTMP_SUPPORT flag.
13 */ 13 */
14
15/* getopt not needed */
16
17//config:config UPTIME 14//config:config UPTIME
18//config: bool "uptime" 15//config: bool "uptime"
19//config: default y 16//config: default y
@@ -30,6 +27,10 @@
30//config: help 27//config: help
31//config: Makes uptime display the number of users currently logged on. 28//config: Makes uptime display the number of users currently logged on.
32 29
30//applet:IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP))
31
32//kbuild:lib-$(CONFIG_UPTIME) += uptime.o
33
33//usage:#define uptime_trivial_usage 34//usage:#define uptime_trivial_usage
34//usage: "" 35//usage: ""
35//usage:#define uptime_full_usage "\n\n" 36//usage:#define uptime_full_usage "\n\n"
diff --git a/procps/watch.c b/procps/watch.c
index 20859c3cd..bb34124c0 100644
--- a/procps/watch.c
+++ b/procps/watch.c
@@ -11,6 +11,17 @@
11/* BB_AUDIT SUSv3 N/A */ 11/* BB_AUDIT SUSv3 N/A */
12/* BB_AUDIT GNU defects -- only option -n is supported. */ 12/* BB_AUDIT GNU defects -- only option -n is supported. */
13 13
14//config:config WATCH
15//config: bool "watch"
16//config: default y
17//config: help
18//config: watch is used to execute a program periodically, showing
19//config: output to the screen.
20
21//applet:IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP))
22
23//kbuild:lib-$(CONFIG_WATCH) += watch.o
24
14//usage:#define watch_trivial_usage 25//usage:#define watch_trivial_usage
15//usage: "[-n SEC] [-t] PROG ARGS" 26//usage: "[-n SEC] [-t] PROG ARGS"
16//usage:#define watch_full_usage "\n\n" 27//usage:#define watch_full_usage "\n\n"