Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162293598
D14683.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14683.diff
View Options
Index: head/bin/ps/extern.h
===================================================================
--- head/bin/ps/extern.h
+++ head/bin/ps/extern.h
@@ -55,6 +55,7 @@
VARENT *find_varentry(VAR *);
const char *fmt_argv(char **, char *, char *, size_t);
double getpcpu(const KINFO *);
+char *jailname(KINFO *, VARENT *);
char *kvar(KINFO *, VARENT *);
char *label(KINFO *, VARENT *);
char *loginclass(KINFO *, VARENT *);
Index: head/bin/ps/keyword.c
===================================================================
--- head/bin/ps/keyword.c
+++ head/bin/ps/keyword.c
@@ -108,6 +108,7 @@
{"inblk", "INBLK", NULL, "read-blocks", USER, rvar, ROFF(ru_inblock),
LONG, "ld", 0},
{"inblock", "", "inblk", NULL, 0, NULL, 0, CHAR, NULL, 0},
+ {"jail", "JAIL", NULL, "jail-name", LJUST, jailname, 0, CHAR, NULL, 0},
{"jid", "JID", NULL, "jail-id", 0, kvar, KOFF(ki_jid), INT, "d", 0},
{"jobc", "JOBC", NULL, "job-control-count", 0, kvar, KOFF(ki_jobc),
SHORT, "d", 0},
Index: head/bin/ps/print.c
===================================================================
--- head/bin/ps/print.c
+++ head/bin/ps/print.c
@@ -51,6 +51,7 @@
#include <err.h>
#include <grp.h>
+#include <jail.h>
#include <langinfo.h>
#include <locale.h>
#include <math.h>
@@ -839,4 +840,17 @@
return (strdup("-"));
}
return (strdup(k->ki_p->ki_loginclass));
+}
+
+char *
+jailname(KINFO *k, VARENT *ve __unused)
+{
+ char *name;
+
+ if (k->ki_p->ki_jid == 0)
+ return (strdup("-"));
+ name = jail_getname(k->ki_p->ki_jid);
+ if (name == NULL)
+ return (strdup("-"));
+ return (name);
}
Index: head/bin/ps/ps.1
===================================================================
--- head/bin/ps/ps.1
+++ head/bin/ps/ps.1
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd January 23, 2018
+.Dd March 13, 2018
.Dt PS 1
.Os
.Sh NAME
@@ -576,6 +576,8 @@
.It Cm inblk
total blocks read (alias
.Cm inblock )
+.It Cm jail
+jail name
.It Cm jid
jail ID
.It Cm jobc
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 12, 7:00 PM (58 m, 17 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35007577
Default Alt Text
D14683.diff (1 KB)
Attached To
Mode
D14683: Add a "jail" keyword to list the name of a jail rather than its ID.
Attached
Detach File
Event Timeline
Log In to Comment