diff options
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index b380313092bd..6ba2746e4517 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -281,14 +281,23 @@ static inline char *task_sig(struct task_struct *p, char *buffer) | |||
281 | return buffer; | 281 | return buffer; |
282 | } | 282 | } |
283 | 283 | ||
284 | static char *render_cap_t(const char *header, kernel_cap_t *a, char *buffer) | ||
285 | { | ||
286 | unsigned __capi; | ||
287 | |||
288 | buffer += sprintf(buffer, "%s", header); | ||
289 | CAP_FOR_EACH_U32(__capi) { | ||
290 | buffer += sprintf(buffer, "%08x", | ||
291 | a->cap[(_LINUX_CAPABILITY_U32S-1) - __capi]); | ||
292 | } | ||
293 | return buffer + sprintf(buffer, "\n"); | ||
294 | } | ||
295 | |||
284 | static inline char *task_cap(struct task_struct *p, char *buffer) | 296 | static inline char *task_cap(struct task_struct *p, char *buffer) |
285 | { | 297 | { |
286 | return buffer + sprintf(buffer, "CapInh:\t%016x\n" | 298 | buffer = render_cap_t("CapInh:\t", &p->cap_inheritable, buffer); |
287 | "CapPrm:\t%016x\n" | 299 | buffer = render_cap_t("CapPrm:\t", &p->cap_permitted, buffer); |
288 | "CapEff:\t%016x\n", | 300 | return render_cap_t("CapEff:\t", &p->cap_effective, buffer); |
289 | cap_t(p->cap_inheritable), | ||
290 | cap_t(p->cap_permitted), | ||
291 | cap_t(p->cap_effective)); | ||
292 | } | 301 | } |
293 | 302 | ||
294 | static inline char *task_context_switch_counts(struct task_struct *p, | 303 | static inline char *task_context_switch_counts(struct task_struct *p, |