summaryrefslogtreecommitdiffhomepage
path: root/procps
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-07-29 02:20:17 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-29 02:20:17 +0200
commit5d725fd627e23b4be5d5a8b843a5a9fc9bc9e410 (patch)
tree2b138b7d99c0df240ad250c4199659fdf3a65c96 /procps
parent147d2ce3dd98945a328ab9390dc562923b17c2f3 (diff)
ps: implement -o sid
function old new delta func_sid - 29 +29 out_spec 320 340 +20 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 49/0) Total: 49 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r--procps/ps.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/procps/ps.c b/procps/ps.c
index d4d787d78..6348df5f2 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -340,6 +340,11 @@ static void func_pgid(char *buf, int size, const procps_status_t *ps)
sprintf(buf, "%*u", size, ps->pgid);
}
+static void func_sid(char *buf, int size, const procps_status_t *ps)
+{
+ sprintf(buf, "%*u", size, ps->sid);
+}
+
static void put_lu(char *buf, int size, unsigned long u)
{
char buf4[5];
@@ -458,6 +463,7 @@ static const ps_out_t out_spec[] = {
{ 6 , "tty" ,"TT" ,func_tty ,PSSCAN_TTY },
{ 4 , "vsz" ,"VSZ" ,func_vsz ,PSSCAN_VSZ },
/* Not mandated, but useful: */
+ { 5 , "sid" ,"SID" ,func_sid ,PSSCAN_SID },
{ 4 , "stat" ,"STAT" ,func_state ,PSSCAN_STATE },
{ 4 , "rss" ,"RSS" ,func_rss ,PSSCAN_RSS },
#if ENABLE_SELINUX