diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-23 06:23:44 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-23 06:23:44 +0100 |
commit | f8f81ed7aaf90897fa9a4687dac75152740a71e2 (patch) | |
tree | a5c624d8187016e4369be0be2667a2f5de752d03 | |
parent | f88e3bfa8ded4f1c7e7d2143a1cfcbbdfe5e8541 (diff) | |
download | busybox-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.h | 14 | ||||
-rw-r--r-- | procps/Config.src | 140 | ||||
-rw-r--r-- | procps/Kbuild.src | 15 | ||||
-rw-r--r-- | procps/free.c | 12 | ||||
-rw-r--r-- | procps/fuser.c | 11 | ||||
-rw-r--r-- | procps/kill.c | 30 | ||||
-rw-r--r-- | procps/pgrep.c | 17 | ||||
-rw-r--r-- | procps/pidof.c | 26 | ||||
-rw-r--r-- | procps/ps.c | 49 | ||||
-rw-r--r-- | procps/renice.c | 10 | ||||
-rw-r--r-- | procps/sysctl.c | 9 | ||||
-rw-r--r-- | procps/top.c | 5 | ||||
-rw-r--r-- | procps/uptime.c | 7 | ||||
-rw-r--r-- | procps/watch.c | 11 |
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)) | |||
124 | IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) | 124 | IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) |
125 | IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) | 125 | IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) |
126 | IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) | 126 | IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) |
127 | IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
128 | IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) | 127 | IF_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)) | |||
133 | IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 132 | IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
134 | IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget)) | 133 | IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget)) |
135 | IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput)) | 134 | IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput)) |
136 | IF_FUSER(APPLET(fuser, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
137 | IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 135 | IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
138 | IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) | 136 | IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) |
139 | IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 137 | IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
@@ -163,9 +161,6 @@ IF_IPROUTE(APPLET(iproute, BB_DIR_SBIN, BB_SUID_DROP)) | |||
163 | IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP)) | 161 | IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP)) |
164 | IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP)) | 162 | IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP)) |
165 | IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) | 163 | IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) |
166 | IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP)) | ||
167 | IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) | ||
168 | IF_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)) |
170 | IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) | 165 | IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) |
171 | IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 166 | IF_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)) | |||
201 | IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) | 196 | IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) |
202 | IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP)) | 197 | IF_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)) |
204 | IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
205 | IF_PIDOF(APPLET(pidof, BB_DIR_BIN, BB_SUID_DROP)) | ||
206 | IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) | 199 | IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) |
207 | IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill)) | ||
208 | IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 200 | IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
209 | IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) | 201 | IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) |
210 | IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) | 202 | IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) |
211 | IF_PS(APPLET(ps, BB_DIR_BIN, BB_SUID_DROP)) | ||
212 | IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP)) | 203 | IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP)) |
213 | IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) | 204 | IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) |
214 | IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 205 | IF_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)) | |||
217 | IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 208 | IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
218 | IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) | 209 | IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) |
219 | IF_REFORMIME(APPLET(reformime, BB_DIR_BIN, BB_SUID_DROP)) | 210 | IF_REFORMIME(APPLET(reformime, BB_DIR_BIN, BB_SUID_DROP)) |
220 | IF_RENICE(APPLET(renice, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
221 | IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) | 211 | IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) |
222 | IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) | 212 | IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) |
223 | IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) | 213 | IF_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)) | |||
249 | IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) | 239 | IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) |
250 | IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) | 240 | IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) |
251 | IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) | 241 | IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) |
252 | IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP)) | ||
253 | IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) | 242 | IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) |
254 | IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) | 243 | IF_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)) | |||
262 | IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) | 251 | IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) |
263 | IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 252 | IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
264 | #endif | 253 | #endif |
265 | IF_TOP(APPLET(top, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
266 | IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) | 254 | IF_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: */ |
268 | IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) | 256 | IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) |
@@ -278,12 +266,10 @@ IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) | |||
278 | IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) | 266 | IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) |
279 | IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) | 267 | IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) |
280 | IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) | 268 | IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) |
281 | IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
282 | IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) | 269 | IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) |
283 | IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) | 270 | IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) |
284 | IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) | 271 | IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) |
285 | IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP)) | 272 | IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP)) |
286 | IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) | ||
287 | IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) | 273 | IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) |
288 | IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) | 274 | IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) |
289 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) | 275 | IF_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 | ||
8 | INSERT | 8 | INSERT |
9 | 9 | ||
10 | config 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 | |||
19 | config 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 | |||
27 | config 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 | |||
35 | config 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 | |||
44 | config KILLALL5 | ||
45 | bool "killall5" | ||
46 | default y | ||
47 | depends on KILL | ||
48 | |||
49 | config PGREP | ||
50 | bool "pgrep" | ||
51 | default y | ||
52 | help | ||
53 | Look for processes by name. | ||
54 | |||
55 | config 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 | |||
62 | config 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 | |||
69 | config 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 | |||
78 | config PKILL | ||
79 | bool "pkill" | ||
80 | default y | ||
81 | help | ||
82 | Send signals to processes by name. | ||
83 | |||
84 | config PS | ||
85 | bool "ps" | ||
86 | default y | ||
87 | help | ||
88 | ps gives a snapshot of the current processes. | ||
89 | |||
90 | config 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 | |||
99 | config 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 | |||
107 | config 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 | |||
115 | config 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 | |||
122 | config 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 | |||
130 | config RENICE | ||
131 | bool "renice" | ||
132 | default y | ||
133 | help | ||
134 | Renice alters the scheduling priority of one or more running | ||
135 | processes. | ||
136 | |||
137 | config BB_SYSCTL | ||
138 | bool "sysctl" | ||
139 | default y | ||
140 | help | ||
141 | Configure kernel parameters at runtime. | ||
142 | |||
143 | config FEATURE_SHOW_THREADS | 10 | config 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 | ||
151 | config 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 | |||
158 | endmenu | 18 | endmenu |
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 @@ | |||
7 | lib-y:= | 7 | lib-y:= |
8 | 8 | ||
9 | INSERT | 9 | INSERT |
10 | lib-$(CONFIG_FREE) += free.o | 10 | |
11 | lib-$(CONFIG_FUSER) += fuser.o | 11 | lib-$(CONFIG_ASH) += kill.o # used for built-in kill by ash |
12 | lib-$(CONFIG_KILL) += kill.o | ||
13 | lib-$(CONFIG_ASH) += kill.o # used for built-in kill by ash | ||
14 | lib-$(CONFIG_PGREP) += pgrep.o | ||
15 | lib-$(CONFIG_PKILL) += pgrep.o | ||
16 | lib-$(CONFIG_PIDOF) += pidof.o | ||
17 | lib-$(CONFIG_PS) += ps.o | ||
18 | lib-$(CONFIG_RENICE) += renice.o | ||
19 | lib-$(CONFIG_BB_SYSCTL) += sysctl.o | ||
20 | lib-$(CONFIG_TOP) += top.o | ||
21 | lib-$(CONFIG_UPTIME) += uptime.o | ||
22 | lib-$(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" |