aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/iostat.c2
-rw-r--r--procps/kill.c2
-rw-r--r--procps/mpstat.c2
-rw-r--r--procps/ps.c13
-rw-r--r--procps/smemcap.c1
5 files changed, 17 insertions, 3 deletions
diff --git a/procps/iostat.c b/procps/iostat.c
index 1c6fb87ba..7bf567c34 100644
--- a/procps/iostat.c
+++ b/procps/iostat.c
@@ -28,7 +28,7 @@
28#if 1 28#if 1
29typedef unsigned long long cputime_t; 29typedef unsigned long long cputime_t;
30typedef long long icputime_t; 30typedef long long icputime_t;
31# define FMT_DATA "ll" 31# define FMT_DATA LL_FMT
32# define CPUTIME_MAX (~0ULL) 32# define CPUTIME_MAX (~0ULL)
33#else 33#else
34typedef unsigned long cputime_t; 34typedef unsigned long cputime_t;
diff --git a/procps/kill.c b/procps/kill.c
index a30a79dd8..073e74332 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -207,6 +207,7 @@ int kill_main(int argc UNUSED_PARAM, char **argv)
207 do_it_now: 207 do_it_now:
208 pid = getpid(); 208 pid = getpid();
209 209
210#if ENABLE_KILLALL5
210 if (is_killall5) { 211 if (is_killall5) {
211 pid_t sid; 212 pid_t sid;
212 procps_status_t* p = NULL; 213 procps_status_t* p = NULL;
@@ -264,6 +265,7 @@ int kill_main(int argc UNUSED_PARAM, char **argv)
264 kill(-1, SIGCONT); 265 kill(-1, SIGCONT);
265 return errors; 266 return errors;
266 } 267 }
268#endif
267 269
268#if ENABLE_KILL || ENABLE_KILLALL 270#if ENABLE_KILL || ENABLE_KILLALL
269 /* Pid or name is required for kill/killall */ 271 /* Pid or name is required for kill/killall */
diff --git a/procps/mpstat.c b/procps/mpstat.c
index 4ea1b5d97..e7dc4312a 100644
--- a/procps/mpstat.c
+++ b/procps/mpstat.c
@@ -49,7 +49,7 @@
49#if 1 49#if 1
50typedef unsigned long long data_t; 50typedef unsigned long long data_t;
51typedef long long idata_t; 51typedef long long idata_t;
52#define FMT_DATA "ll" 52#define FMT_DATA LL_FMT
53#define DATA_MAX ULLONG_MAX 53#define DATA_MAX ULLONG_MAX
54#else 54#else
55typedef unsigned long data_t; 55typedef unsigned long data_t;
diff --git a/procps/ps.c b/procps/ps.c
index 815c11578..a4de11379 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -35,7 +35,6 @@
35//config: bool "Enable -o time and -o etime specifiers" 35//config: bool "Enable -o time and -o etime specifiers"
36//config: default y 36//config: default y
37//config: depends on (PS || MINIPS) && DESKTOP 37//config: depends on (PS || MINIPS) && DESKTOP
38//config: select PLATFORM_LINUX
39//config: 38//config:
40//config:config FEATURE_PS_UNUSUAL_SYSTEMS 39//config:config FEATURE_PS_UNUSUAL_SYSTEMS
41//config: bool "Support Linux prior to 2.4.0 and non-ELF systems" 40//config: bool "Support Linux prior to 2.4.0 and non-ELF systems"
@@ -126,6 +125,8 @@ static unsigned long get_uptime(void)
126 if (sysinfo(&info) < 0) 125 if (sysinfo(&info) < 0)
127 return 0; 126 return 0;
128 return info.uptime; 127 return info.uptime;
128#elif ENABLE_PLATFORM_MINGW32
129 return GetTickCount64()/1000;
129#elif 1 130#elif 1
130 unsigned long uptime; 131 unsigned long uptime;
131 char buf[sizeof(uptime)*3 + 2]; 132 char buf[sizeof(uptime)*3 + 2];
@@ -238,10 +239,12 @@ static void func_comm(char *buf, int size, const procps_status_t *ps)
238 safe_strncpy(buf, ps->comm, size+1); 239 safe_strncpy(buf, ps->comm, size+1);
239} 240}
240 241
242#if !ENABLE_PLATFORM_MINGW32
241static void func_state(char *buf, int size, const procps_status_t *ps) 243static void func_state(char *buf, int size, const procps_status_t *ps)
242{ 244{
243 safe_strncpy(buf, ps->state, size+1); 245 safe_strncpy(buf, ps->state, size+1);
244} 246}
247#endif
245 248
246static void func_args(char *buf, int size, const procps_status_t *ps) 249static void func_args(char *buf, int size, const procps_status_t *ps)
247{ 250{
@@ -258,6 +261,7 @@ static void func_ppid(char *buf, int size, const procps_status_t *ps)
258 sprintf(buf, "%*u", size, ps->ppid); 261 sprintf(buf, "%*u", size, ps->ppid);
259} 262}
260 263
264#if !ENABLE_PLATFORM_MINGW32
261static void func_pgid(char *buf, int size, const procps_status_t *ps) 265static void func_pgid(char *buf, int size, const procps_status_t *ps)
262{ 266{
263 sprintf(buf, "%*u", size, ps->pgid); 267 sprintf(buf, "%*u", size, ps->pgid);
@@ -294,6 +298,7 @@ static void func_tty(char *buf, int size, const procps_status_t *ps)
294 if (ps->tty_major) /* tty field of "0" means "no tty" */ 298 if (ps->tty_major) /* tty field of "0" means "no tty" */
295 snprintf(buf, size+1, "%u,%u", ps->tty_major, ps->tty_minor); 299 snprintf(buf, size+1, "%u,%u", ps->tty_major, ps->tty_minor);
296} 300}
301#endif
297 302
298#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS 303#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS
299static void func_rgroup(char *buf, int size, const procps_status_t *ps) 304static void func_rgroup(char *buf, int size, const procps_status_t *ps)
@@ -384,7 +389,9 @@ static const ps_out_t out_spec[] = {
384 { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM }, 389 { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM },
385 { 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID }, 390 { 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID },
386 { 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID }, 391 { 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID },
392#if !ENABLE_PLATFORM_MINGW32
387 { 5 , "pgid" ,"PGID" ,func_pgid ,PSSCAN_PGID }, 393 { 5 , "pgid" ,"PGID" ,func_pgid ,PSSCAN_PGID },
394#endif
388#if ENABLE_FEATURE_PS_TIME 395#if ENABLE_FEATURE_PS_TIME
389 { sizeof("ELAPSED")-1, "etime" ,"ELAPSED",func_etime ,PSSCAN_START_TIME }, 396 { sizeof("ELAPSED")-1, "etime" ,"ELAPSED",func_etime ,PSSCAN_START_TIME },
390#endif 397#endif
@@ -397,12 +404,14 @@ static const ps_out_t out_spec[] = {
397#if ENABLE_FEATURE_PS_TIME 404#if ENABLE_FEATURE_PS_TIME
398 { 5 , "time" ,"TIME" ,func_time ,PSSCAN_STIME | PSSCAN_UTIME }, 405 { 5 , "time" ,"TIME" ,func_time ,PSSCAN_STIME | PSSCAN_UTIME },
399#endif 406#endif
407#if !ENABLE_PLATFORM_MINGW32
400 { 6 , "tty" ,"TT" ,func_tty ,PSSCAN_TTY }, 408 { 6 , "tty" ,"TT" ,func_tty ,PSSCAN_TTY },
401 { 4 , "vsz" ,"VSZ" ,func_vsz ,PSSCAN_VSZ }, 409 { 4 , "vsz" ,"VSZ" ,func_vsz ,PSSCAN_VSZ },
402/* Not mandated, but useful: */ 410/* Not mandated, but useful: */
403 { 5 , "sid" ,"SID" ,func_sid ,PSSCAN_SID }, 411 { 5 , "sid" ,"SID" ,func_sid ,PSSCAN_SID },
404 { 4 , "stat" ,"STAT" ,func_state ,PSSCAN_STATE }, 412 { 4 , "stat" ,"STAT" ,func_state ,PSSCAN_STATE },
405 { 4 , "rss" ,"RSS" ,func_rss ,PSSCAN_RSS }, 413 { 4 , "rss" ,"RSS" ,func_rss ,PSSCAN_RSS },
414#endif
406#if ENABLE_SELINUX 415#if ENABLE_SELINUX
407 { 35 , "label" ,"LABEL" ,func_label ,PSSCAN_CONTEXT }, 416 { 35 , "label" ,"LABEL" ,func_label ,PSSCAN_CONTEXT },
408#endif 417#endif
@@ -541,6 +550,8 @@ static void format_process(const procps_status_t *ps)
541#if ENABLE_SELINUX 550#if ENABLE_SELINUX
542# define SELINUX_O_PREFIX "label," 551# define SELINUX_O_PREFIX "label,"
543# define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" IF_FEATURE_PS_TIME(",time") ",args") 552# define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" IF_FEATURE_PS_TIME(",time") ",args")
553#elif ENABLE_PLATFORM_MINGW32
554# define DEFAULT_O_STR ("pid,ppid,user" IF_FEATURE_PS_TIME(",time,etime") ",args")
544#else 555#else
545# define DEFAULT_O_STR ("pid,user" IF_FEATURE_PS_TIME(",time") ",args") 556# define DEFAULT_O_STR ("pid,user" IF_FEATURE_PS_TIME(",time") ",args")
546#endif 557#endif
diff --git a/procps/smemcap.c b/procps/smemcap.c
index 2f8ab192e..01acbf74e 100644
--- a/procps/smemcap.c
+++ b/procps/smemcap.c
@@ -19,6 +19,7 @@
19//kbuild:lib-$(CONFIG_SMEMCAP) += smemcap.o 19//kbuild:lib-$(CONFIG_SMEMCAP) += smemcap.o
20 20
21#include "libbb.h" 21#include "libbb.h"
22#define BB_ARCHIVE_PUBLIC
22#include "bb_archive.h" 23#include "bb_archive.h"
23 24
24struct fileblock { 25struct fileblock {