diff options
| author | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
| commit | bb8d79eadbba1942dbdb9f9cee5c47833afe269f (patch) | |
| tree | b8c517e9ca895d60d7227aef7177b6291df5e2cd /procps | |
| parent | 9fa1e4990e655a85025c9d270a1606983e375e47 (diff) | |
| parent | 7d877fc9312a742b06125927bb1d34bd35398c6c (diff) | |
| download | busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.gz busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.bz2 busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'procps')
| -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 | 48 | ||||
| -rw-r--r-- | procps/pgrep.c | 19 | ||||
| -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 |
13 files changed, 198 insertions, 164 deletions
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..57a33bcaa 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
| @@ -7,6 +7,38 @@ | |||
| 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: help | ||
| 22 | //config: killall sends a signal to all processes running any of the | ||
| 23 | //config: specified commands. If no signal name is specified, SIGTERM is | ||
| 24 | //config: sent. | ||
| 25 | //config: | ||
| 26 | //config:config KILLALL5 | ||
| 27 | //config: bool "killall5" | ||
| 28 | //config: default y | ||
| 29 | //config: help | ||
| 30 | //config: The SystemV killall command. killall5 sends a signal | ||
| 31 | //config: to all processes except kernel threads and the processes | ||
| 32 | //config: in its own session, so it won't kill the shell that is running | ||
| 33 | //config: the script it was called from. | ||
| 34 | |||
| 35 | //applet:IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 36 | //applet:IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) | ||
| 37 | //applet:IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_SBIN, BB_SUID_DROP, killall5)) | ||
| 38 | |||
| 39 | //kbuild:lib-$(CONFIG_KILL) += kill.o | ||
| 40 | //kbuild:lib-$(CONFIG_KILLALL) += kill.o | ||
| 41 | //kbuild:lib-$(CONFIG_KILLALL5) += kill.o | ||
| 10 | 42 | ||
| 11 | //usage:#define kill_trivial_usage | 43 | //usage:#define kill_trivial_usage |
| 12 | //usage: "[-l] [-SIG] PID..." | 44 | //usage: "[-l] [-SIG] PID..." |
| @@ -65,17 +97,23 @@ int kill_main(int argc UNUSED_PARAM, char **argv) | |||
| 65 | char *arg; | 97 | char *arg; |
| 66 | pid_t pid; | 98 | pid_t pid; |
| 67 | int signo = SIGTERM, errors = 0, quiet = 0; | 99 | int signo = SIGTERM, errors = 0, quiet = 0; |
| 68 | #if !ENABLE_KILLALL && !ENABLE_KILLALL5 | 100 | #if ENABLE_KILL && !ENABLE_KILLALL && !ENABLE_KILLALL5 |
| 69 | #define killall 0 | 101 | # define killall 0 |
| 70 | #define killall5 0 | 102 | # define killall5 0 |
| 103 | #elif !ENABLE_KILL && ENABLE_KILLALL && !ENABLE_KILLALL5 | ||
| 104 | # define killall 1 | ||
| 105 | # define killall5 0 | ||
| 106 | #elif !ENABLE_KILL && !ENABLE_KILLALL && ENABLE_KILLALL5 | ||
| 107 | # define killall 0 | ||
| 108 | # define killall5 1 | ||
| 71 | #else | 109 | #else |
| 72 | /* How to determine who we are? find 3rd char from the end: | 110 | /* How to determine who we are? find 3rd char from the end: |
| 73 | * kill, killall, killall5 | 111 | * kill, killall, killall5 |
| 74 | * ^i ^a ^l - it's unique | 112 | * ^i ^a ^l - it's unique |
| 75 | * (checking from the start is complicated by /bin/kill... case) */ | 113 | * (checking from the start is complicated by /bin/kill... case) */ |
| 76 | const char char3 = argv[0][strlen(argv[0]) - 3]; | 114 | const char char3 = argv[0][strlen(argv[0]) - 3]; |
| 77 | #define killall (ENABLE_KILLALL && char3 == 'a') | 115 | # define killall (ENABLE_KILLALL && char3 == 'a') |
| 78 | #define killall5 (ENABLE_KILLALL5 && char3 == 'l') | 116 | # define killall5 (ENABLE_KILLALL5 && char3 == 'l') |
| 79 | #endif | 117 | #endif |
| 80 | 118 | ||
| 81 | /* Parse any options */ | 119 | /* Parse any options */ |
diff --git a/procps/pgrep.c b/procps/pgrep.c index 1c594cf96..ac82b5156 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]" |
| @@ -151,7 +168,7 @@ int pgrep_main(int argc UNUSED_PARAM, char **argv) | |||
| 151 | 168 | ||
| 152 | if (ppid2match >= 0 && ppid2match != proc->ppid) | 169 | if (ppid2match >= 0 && ppid2match != proc->ppid) |
| 153 | continue; | 170 | continue; |
| 154 | if (sid2match >= 0 && sid2match != proc->sid) | 171 | if (sid2match >= 0 && sid2match != proc->sid) |
| 155 | continue; | 172 | continue; |
| 156 | 173 | ||
| 157 | /* NB: OPT_INVERT is always 0 or 1 */ | 174 | /* NB: OPT_INVERT is always 0 or 1 */ |
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 c9d33daf4..902811f31 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" |
