aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-07-03 22:16:17 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-07-03 22:16:17 +0200
commitfca70a8cce579ce8cc8caf246c22f0c6e6c6e139 (patch)
tree2c17970b64b12c34624a18cf42b2c39a2cb5329d /include
parentc5d07fba29a477569a96777c9cab73e53b1ddd5c (diff)
downloadbusybox-fca70a8cce579ce8cc8caf246c22f0c6e6c6e139.tar.gz
ps: conditionally support additional -o FIELDs
function old new delta procps_scan 1409 1642 +233 out_spec 220 300 +80 func_ruser - 36 +36 func_rgroup - 36 +36 func_group 13 49 +36 func_nice - 29 +29 buffer_fill_and_print 179 196 +17 send_tree 355 360 +5 mkfs_vfat_main 1604 1609 +5 display_speed 85 90 +5 scriptreplay_main 194 197 +3 find_out_spec 55 58 +3 changepath 192 195 +3 sha1_process_block64 497 484 -13 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 10/1 up/down: 491/-13) Total: 478 bytes Signed-off-by: David Krakov <krakov@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h
index e1c36a57b..77674f8a2 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1276,6 +1276,11 @@ typedef struct procps_status_t {
unsigned sid;
unsigned uid;
unsigned gid;
+#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS
+ unsigned ruid;
+ unsigned rgid;
+ int niceness;
+#endif
unsigned tty_major,tty_minor;
#if ENABLE_FEATURE_TOPMEM
unsigned long mapped_rw;
@@ -1296,6 +1301,7 @@ typedef struct procps_status_t {
int last_seen_on_cpu;
#endif
} procps_status_t;
+/* flag bits for procps_scan(xx, flags) calls */
enum {
PSSCAN_PID = 1 << 0,
PSSCAN_PPID = 1 << 1,
@@ -1322,16 +1328,16 @@ enum {
),
IF_SELINUX(PSSCAN_CONTEXT = 1 << 17,)
PSSCAN_START_TIME = 1 << 18,
- PSSCAN_CPU = 1 << 19,
+ PSSCAN_CPU = (1 << 19) * ENABLE_FEATURE_TOP_SMP_PROCESS,
+ PSSCAN_NICE = (1 << 20) * ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS,
+ PSSCAN_RUIDGID = (1 << 21) * ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS,
/* These are all retrieved from proc/NN/stat in one go: */
PSSCAN_STAT = PSSCAN_PPID | PSSCAN_PGID | PSSCAN_SID
/**/ | PSSCAN_COMM | PSSCAN_STATE
/**/ | PSSCAN_VSZ | PSSCAN_RSS
/**/ | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME
- /**/ | PSSCAN_TTY
-#if ENABLE_FEATURE_TOP_SMP_PROCESS
+ /**/ | PSSCAN_TTY | PSSCAN_NICE
/**/ | PSSCAN_CPU
-#endif
};
//procps_status_t* alloc_procps_scan(void) FAST_FUNC;
void free_procps_scan(procps_status_t* sp) FAST_FUNC;