aboutsummaryrefslogtreecommitdiff
path: root/procps/ps.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-10-24 05:00:29 +0000
committerEric Andersen <andersen@codepoet.org>2001-10-24 05:00:29 +0000
commitbdfd0d78bc44e73d693510e70087857785b3b521 (patch)
tree153a573095afac8d8d0ea857759ecabd77fb28b7 /procps/ps.c
parent9260fc5552a3ee52eb95823aa6689d52a1ffd33c (diff)
downloadbusybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.gz
busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.bz2
busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.zip
Major rework of the directory structure and the entire build system.
-Erik
Diffstat (limited to 'procps/ps.c')
-rw-r--r--procps/ps.c32
1 files changed, 15 insertions, 17 deletions
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