diff options
Diffstat (limited to 'procps')
-rw-r--r-- | procps/Makefile | 40 | ||||
-rw-r--r-- | procps/config.in | 17 | ||||
-rw-r--r-- | procps/free.c | 4 | ||||
-rw-r--r-- | procps/kill.c | 4 | ||||
-rw-r--r-- | procps/pidof.c | 4 | ||||
-rw-r--r-- | procps/ps.c | 32 | ||||
-rw-r--r-- | procps/uptime.c | 6 |
7 files changed, 81 insertions, 26 deletions
diff --git a/procps/Makefile b/procps/Makefile new file mode 100644 index 000000000..0e3bdc254 --- /dev/null +++ b/procps/Makefile | |||
@@ -0,0 +1,40 @@ | |||
1 | # Makefile for busybox | ||
2 | # | ||
3 | # Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> | ||
4 | # | ||
5 | # This program is free software; you can redistribute it and/or modify | ||
6 | # it under the terms of the GNU General Public License as published by | ||
7 | # the Free Software Foundation; either version 2 of the License, or | ||
8 | # (at your option) any later version. | ||
9 | # | ||
10 | # This program 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 | # General Public License for more details. | ||
14 | # | ||
15 | # You should have received a copy of the GNU General Public License | ||
16 | # along with this program; if not, write to the Free Software | ||
17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | # | ||
19 | |||
20 | TOPDIR :=.. | ||
21 | L_TARGET := procps.a | ||
22 | |||
23 | obj-y := | ||
24 | obj-n := | ||
25 | obj- := | ||
26 | |||
27 | obj-$(CONFIG_FREE) += free.o | ||
28 | obj-$(CONFIG_KILL) += kill.o | ||
29 | obj-$(CONFIG_PIDOF) += pidof.o | ||
30 | obj-$(CONFIG_PS) += ps.o | ||
31 | obj-$(CONFIG_RENICE) += renice.o | ||
32 | obj-$(CONFIG_UPTIME) += uptime.o | ||
33 | |||
34 | |||
35 | # Hand off to toplevel Rules.mak | ||
36 | include $(TOPDIR)/Rules.mak | ||
37 | |||
38 | clean: | ||
39 | rm -f $(L_TARGET) *.o core | ||
40 | |||
diff --git a/procps/config.in b/procps/config.in new file mode 100644 index 000000000..0c9c35c06 --- /dev/null +++ b/procps/config.in | |||
@@ -0,0 +1,17 @@ | |||
1 | # | ||
2 | # For a description of the syntax of this configuration file, | ||
3 | # see scripts/kbuild/config-language.txt. | ||
4 | # | ||
5 | |||
6 | mainmenu_option next_comment | ||
7 | comment 'Process Utilities' | ||
8 | |||
9 | bool 'free' CONFIG_FREE | ||
10 | bool 'kill' CONFIG_KILL | ||
11 | bool 'pidof' CONFIG_PIDOF | ||
12 | bool 'ps' CONFIG_PS | ||
13 | bool 'renice' CONFIG_RENICE | ||
14 | bool 'uptime' CONFIG_UPTIME | ||
15 | |||
16 | endmenu | ||
17 | |||
diff --git a/procps/free.c b/procps/free.c index 2e34a972c..cdc0d358c 100644 --- a/procps/free.c +++ b/procps/free.c | |||
@@ -2,8 +2,8 @@ | |||
2 | /* | 2 | /* |
3 | * Mini free implementation for busybox | 3 | * Mini free implementation for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 1999,2000,2001 by Lineo, inc. | 5 | * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen |
6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 6 | * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
diff --git a/procps/kill.c b/procps/kill.c index 3884ebdf4..8b8a9922c 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -40,7 +40,7 @@ extern int kill_main(int argc, char **argv) | |||
40 | int whichApp, sig = SIGTERM; | 40 | int whichApp, sig = SIGTERM; |
41 | const char *name; | 41 | const char *name; |
42 | 42 | ||
43 | #ifdef BB_KILLALL | 43 | #ifdef CONFIG_KILLALL |
44 | /* Figure out what we are trying to do here */ | 44 | /* Figure out what we are trying to do here */ |
45 | whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; | 45 | whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; |
46 | #else | 46 | #else |
@@ -108,7 +108,7 @@ extern int kill_main(int argc, char **argv) | |||
108 | argv++; | 108 | argv++; |
109 | } | 109 | } |
110 | } | 110 | } |
111 | #ifdef BB_KILLALL | 111 | #ifdef CONFIG_KILLALL |
112 | else { | 112 | else { |
113 | int all_found = TRUE; | 113 | int all_found = TRUE; |
114 | pid_t myPid=getpid(); | 114 | pid_t myPid=getpid(); |
diff --git a/procps/pidof.c b/procps/pidof.c index 50dffd387..5a40288dc 100644 --- a/procps/pidof.c +++ b/procps/pidof.c | |||
@@ -2,8 +2,8 @@ | |||
2 | /* | 2 | /* |
3 | * pidof implementation for busybox | 3 | * pidof implementation for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 2001 by Lineo, inc. | 5 | * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen |
6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 6 | * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
diff --git a/procps/ps.c b/procps/ps.c index 9e96a5402..fcb605a6e 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -2,15 +2,8 @@ | |||
2 | /* | 2 | /* |
3 | * Mini ps implementation(s) for busybox | 3 | * Mini ps implementation(s) for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 1999,2000,2001 by Lineo, inc. | 5 | * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen |
6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 6 | * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> |
7 | * | ||
8 | * | ||
9 | * This contains _two_ implementations of ps for Linux. One uses the | ||
10 | * traditional /proc virtual filesystem, and the other use the devps kernel | ||
11 | * driver (written by Erik Andersen to avoid using /proc thereby saving 100k+). | ||
12 | * | ||
13 | * | ||
14 | * | 7 | * |
15 | * This program is free software; you can redistribute it and/or modify it | 8 | * This program is free software; you can redistribute it and/or modify it |
16 | * under the terms of the GNU General Public License as published by the Free | 9 | * under the terms of the GNU General Public License as published by the Free |
@@ -25,7 +18,12 @@ | |||
25 | * You should have received a copy of the GNU General Public License along with | 18 | * You should have received a copy of the GNU General Public License along with |
26 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 19 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
27 | * Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Place, Suite 330, Boston, MA 02111-1307 USA |
28 | * | 21 | */ |
22 | |||
23 | /* | ||
24 | * This contains _two_ implementations of ps for Linux. One uses the | ||
25 | * traditional /proc virtual filesystem, and the other use the devps kernel | ||
26 | * driver (written by Erik Andersen to avoid using /proc thereby saving 100k+). | ||
29 | */ | 27 | */ |
30 | 28 | ||
31 | #include <stdio.h> | 29 | #include <stdio.h> |
@@ -44,7 +42,7 @@ static const int TERMINAL_WIDTH = 79; /* not 80 in case terminal has linefo | |||
44 | 42 | ||
45 | 43 | ||
46 | 44 | ||
47 | #if ! defined BB_FEATURE_USE_DEVPS_PATCH | 45 | #if ! defined CONFIG_FEATURE_USE_DEVPS_PATCH |
48 | 46 | ||
49 | /* The following is the first ps implementation -- | 47 | /* The following is the first ps implementation -- |
50 | * the one using the /proc virtual filesystem. | 48 | * the one using the /proc virtual filesystem. |
@@ -114,7 +112,7 @@ extern int ps_main(int argc, char **argv) | |||
114 | char path[32], sbuf[512]; | 112 | char path[32], sbuf[512]; |
115 | char uidName[9]; | 113 | char uidName[9]; |
116 | int len, i, c; | 114 | int len, i, c; |
117 | #ifdef BB_FEATURE_AUTOWIDTH | 115 | #ifdef CONFIG_FEATURE_AUTOWIDTH |
118 | struct winsize win = { 0, 0, 0, 0 }; | 116 | struct winsize win = { 0, 0, 0, 0 }; |
119 | int terminal_width = TERMINAL_WIDTH; | 117 | int terminal_width = TERMINAL_WIDTH; |
120 | #else | 118 | #else |
@@ -127,7 +125,7 @@ extern int ps_main(int argc, char **argv) | |||
127 | if (!dir) | 125 | if (!dir) |
128 | error_msg_and_die("Can't open /proc"); | 126 | error_msg_and_die("Can't open /proc"); |
129 | 127 | ||
130 | #ifdef BB_FEATURE_AUTOWIDTH | 128 | #ifdef CONFIG_FEATURE_AUTOWIDTH |
131 | ioctl(fileno(stdout), TIOCGWINSZ, &win); | 129 | ioctl(fileno(stdout), TIOCGWINSZ, &win); |
132 | if (win.ws_col > 0) | 130 | if (win.ws_col > 0) |
133 | terminal_width = win.ws_col - 1; | 131 | terminal_width = win.ws_col - 1; |
@@ -169,7 +167,7 @@ extern int ps_main(int argc, char **argv) | |||
169 | } | 167 | } |
170 | 168 | ||
171 | 169 | ||
172 | #else /* BB_FEATURE_USE_DEVPS_PATCH */ | 170 | #else /* CONFIG_FEATURE_USE_DEVPS_PATCH */ |
173 | 171 | ||
174 | 172 | ||
175 | /* The following is the second ps implementation -- | 173 | /* The following is the second ps implementation -- |
@@ -187,7 +185,7 @@ extern int ps_main(int argc, char **argv) | |||
187 | pid_t* pid_array = NULL; | 185 | pid_t* pid_array = NULL; |
188 | struct pid_info info; | 186 | struct pid_info info; |
189 | char uidName[9]; | 187 | char uidName[9]; |
190 | #ifdef BB_FEATURE_AUTOWIDTH | 188 | #ifdef CONFIG_FEATURE_AUTOWIDTH |
191 | struct winsize win = { 0, 0, 0, 0 }; | 189 | struct winsize win = { 0, 0, 0, 0 }; |
192 | int terminal_width = TERMINAL_WIDTH; | 190 | int terminal_width = TERMINAL_WIDTH; |
193 | #else | 191 | #else |
@@ -217,7 +215,7 @@ extern int ps_main(int argc, char **argv) | |||
217 | if (ioctl (fd, DEVPS_GET_PID_LIST, pid_array)<0) | 215 | if (ioctl (fd, DEVPS_GET_PID_LIST, pid_array)<0) |
218 | perror_msg_and_die("\nDEVPS_GET_PID_LIST"); | 216 | perror_msg_and_die("\nDEVPS_GET_PID_LIST"); |
219 | 217 | ||
220 | #ifdef BB_FEATURE_AUTOWIDTH | 218 | #ifdef CONFIG_FEATURE_AUTOWIDTH |
221 | ioctl(fileno(stdout), TIOCGWINSZ, &win); | 219 | ioctl(fileno(stdout), TIOCGWINSZ, &win); |
222 | if (win.ws_col > 0) | 220 | if (win.ws_col > 0) |
223 | terminal_width = win.ws_col - 1; | 221 | terminal_width = win.ws_col - 1; |
@@ -262,5 +260,5 @@ extern int ps_main(int argc, char **argv) | |||
262 | exit (0); | 260 | exit (0); |
263 | } | 261 | } |
264 | 262 | ||
265 | #endif /* BB_FEATURE_USE_DEVPS_PATCH */ | 263 | #endif /* CONFIG_FEATURE_USE_DEVPS_PATCH */ |
266 | 264 | ||
diff --git a/procps/uptime.c b/procps/uptime.c index 6758d959e..85ff2233c 100644 --- a/procps/uptime.c +++ b/procps/uptime.c | |||
@@ -2,8 +2,8 @@ | |||
2 | /* | 2 | /* |
3 | * Mini uptime implementation for busybox | 3 | * Mini uptime implementation for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 1999,2000,2001 by Lineo, inc. | 5 | * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen |
6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 6 | * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -24,7 +24,7 @@ | |||
24 | /* This version of uptime doesn't display the number of users on the system, | 24 | /* This version of uptime doesn't display the number of users on the system, |
25 | * since busybox init doesn't mess with utmp. For folks using utmp that are | 25 | * since busybox init doesn't mess with utmp. For folks using utmp that are |
26 | * just dying to have # of users reported, feel free to write it as some type | 26 | * just dying to have # of users reported, feel free to write it as some type |
27 | * of BB_FEATURE_UTMP_SUPPORT #define | 27 | * of CONFIG_FEATURE_UTMP_SUPPORT #define |
28 | */ | 28 | */ |
29 | 29 | ||
30 | /* getopt not needed */ | 30 | /* getopt not needed */ |