diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-15 09:48:03 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-15 16:17:16 +1000 |
commit | 9e713dacbf3b6f8d114a337271c57dfccec58af7 (patch) | |
tree | ac895bc51770d33d5f203ba0579828642ed93c65 | |
parent | 903abcceb656701cd57a94404f1e13626618b1c9 (diff) | |
download | busybox-w32-9e713dacbf3b6f8d114a337271c57dfccec58af7.tar.gz busybox-w32-9e713dacbf3b6f8d114a337271c57dfccec58af7.tar.bz2 busybox-w32-9e713dacbf3b6f8d114a337271c57dfccec58af7.zip |
win32: enable ps
Due to limitations in procps_scan(), only -o pid,comm is supported
-rw-r--r-- | procps/ps.c | 10 | ||||
-rw-r--r-- | scripts/defconfig.mingw32 | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/procps/ps.c b/procps/ps.c index 48b55a785..3f7437b38 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -25,6 +25,8 @@ enum { MAX_WIDTH = 2*1024 }; | |||
25 | #if ENABLE_SELINUX | 25 | #if ENABLE_SELINUX |
26 | #define SELINUX_O_PREFIX "label," | 26 | #define SELINUX_O_PREFIX "label," |
27 | #define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" IF_FEATURE_PS_TIME(",time") ",args") | 27 | #define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" IF_FEATURE_PS_TIME(",time") ",args") |
28 | #elif ENABLE_PLATFORM_MINGW32 | ||
29 | #define DEFAULT_O_STR ("pid,comm") | ||
28 | #else | 30 | #else |
29 | #define DEFAULT_O_STR ("pid,user" IF_FEATURE_PS_TIME(",time") ",args") | 31 | #define DEFAULT_O_STR ("pid,user" IF_FEATURE_PS_TIME(",time") ",args") |
30 | #endif | 32 | #endif |
@@ -301,13 +303,19 @@ static void func_pcpu(char *buf, int size, const procps_status_t *ps) | |||
301 | 303 | ||
302 | static const ps_out_t out_spec[] = { | 304 | static const ps_out_t out_spec[] = { |
303 | // Mandated by POSIX: | 305 | // Mandated by POSIX: |
306 | #if !ENABLE_PLATFORM_MINGW32 | ||
304 | { 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID }, | 307 | { 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID }, |
305 | { 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID }, | 308 | { 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID }, |
309 | #endif | ||
306 | { 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM }, | 310 | { 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM }, |
311 | #if !ENABLE_PLATFORM_MINGW32 | ||
307 | { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM }, | 312 | { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM }, |
313 | #endif | ||
308 | { 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID }, | 314 | { 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID }, |
315 | #if !ENABLE_PLATFORM_MINGW32 | ||
309 | { 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID }, | 316 | { 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID }, |
310 | { 5 , "pgid" ,"PGID" ,func_pgid ,PSSCAN_PGID }, | 317 | { 5 , "pgid" ,"PGID" ,func_pgid ,PSSCAN_PGID }, |
318 | #endif | ||
311 | #if ENABLE_FEATURE_PS_TIME | 319 | #if ENABLE_FEATURE_PS_TIME |
312 | { sizeof("ELAPSED")-1, "etime" ,"ELAPSED",func_etime ,PSSCAN_START_TIME }, | 320 | { sizeof("ELAPSED")-1, "etime" ,"ELAPSED",func_etime ,PSSCAN_START_TIME }, |
313 | #endif | 321 | #endif |
@@ -320,10 +328,12 @@ static const ps_out_t out_spec[] = { | |||
320 | #if ENABLE_FEATURE_PS_TIME | 328 | #if ENABLE_FEATURE_PS_TIME |
321 | { 6 , "time" ,"TIME" ,func_time ,PSSCAN_STIME | PSSCAN_UTIME }, | 329 | { 6 , "time" ,"TIME" ,func_time ,PSSCAN_STIME | PSSCAN_UTIME }, |
322 | #endif | 330 | #endif |
331 | #if !ENABLE_PLATFORM_MINGW32 | ||
323 | { 6 , "tty" ,"TT" ,func_tty ,PSSCAN_TTY }, | 332 | { 6 , "tty" ,"TT" ,func_tty ,PSSCAN_TTY }, |
324 | { 4 , "vsz" ,"VSZ" ,func_vsz ,PSSCAN_VSZ }, | 333 | { 4 , "vsz" ,"VSZ" ,func_vsz ,PSSCAN_VSZ }, |
325 | // Not mandated by POSIX, but useful: | 334 | // Not mandated by POSIX, but useful: |
326 | { 4 , "rss" ,"RSS" ,func_rss ,PSSCAN_RSS }, | 335 | { 4 , "rss" ,"RSS" ,func_rss ,PSSCAN_RSS }, |
336 | #endif | ||
327 | #if ENABLE_SELINUX | 337 | #if ENABLE_SELINUX |
328 | { 35 , "label" ,"LABEL" ,func_label ,PSSCAN_CONTEXT }, | 338 | { 35 , "label" ,"LABEL" ,func_label ,PSSCAN_CONTEXT }, |
329 | #endif | 339 | #endif |
diff --git a/scripts/defconfig.mingw32 b/scripts/defconfig.mingw32 index 943c3f4ab..7f5cbc574 100644 --- a/scripts/defconfig.mingw32 +++ b/scripts/defconfig.mingw32 | |||
@@ -854,7 +854,7 @@ CONFIG_FEATURE_MIME_CHARSET="" | |||
854 | # CONFIG_FEATURE_PIDOF_SINGLE is not set | 854 | # CONFIG_FEATURE_PIDOF_SINGLE is not set |
855 | # CONFIG_FEATURE_PIDOF_OMIT is not set | 855 | # CONFIG_FEATURE_PIDOF_OMIT is not set |
856 | # CONFIG_PKILL is not set | 856 | # CONFIG_PKILL is not set |
857 | # CONFIG_PS is not set | 857 | CONFIG_PS=y |
858 | # CONFIG_FEATURE_PS_WIDE is not set | 858 | # CONFIG_FEATURE_PS_WIDE is not set |
859 | # CONFIG_FEATURE_PS_TIME is not set | 859 | # CONFIG_FEATURE_PS_TIME is not set |
860 | # CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set | 860 | # CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set |