prctl: add PR_CAP_AMBIENT parser

* xlat/pr_cap_ambient.in: New file.
* prctl.c: Include "xlat/pr_cap_ambient.h".
(SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT.
This commit is contained in:
Дмитрий Левин 2015-12-06 15:33:53 +00:00
parent 1b283307d1
commit eb76c4be15
2 changed files with 23 additions and 1 deletions

20
prctl.c
View File

@ -3,11 +3,12 @@
#include <sys/prctl.h>
#include "xlat/prctl_options.h"
#include "xlat/pr_unalign_flags.h"
#include "xlat/pr_cap_ambient.h"
#include "xlat/pr_mce_kill.h"
#include "xlat/pr_mce_kill_policy.h"
#include "xlat/pr_set_mm.h"
#include "xlat/pr_tsc.h"
#include "xlat/pr_unalign_flags.h"
#ifndef TASK_COMM_LEN
# define TASK_COMM_LEN 16
@ -142,6 +143,23 @@ SYS_FUNC(prctl)
printxval(cap, tcp->u_arg[1], "CAP_???");
return RVAL_DECODED;
case PR_CAP_AMBIENT:
tprints(", ");
printxval(pr_cap_ambient, tcp->u_arg[1], "PR_CAP_AMBIENT_???");
switch (tcp->u_arg[1]) {
case PR_CAP_AMBIENT_RAISE:
case PR_CAP_AMBIENT_LOWER:
case PR_CAP_AMBIENT_IS_SET:
tprints(", ");
printxval(cap, tcp->u_arg[2], "CAP_???");
print_prctl_args(tcp, 3);
break;
default:
print_prctl_args(tcp, 2);
break;
}
return RVAL_DECODED;
case PR_MCE_KILL:
tprints(", ");
printxval(pr_mce_kill, tcp->u_arg[1], "PR_MCE_KILL_???");

4
xlat/pr_cap_ambient.in Normal file
View File

@ -0,0 +1,4 @@
PR_CAP_AMBIENT_IS_SET 1
PR_CAP_AMBIENT_RAISE 2
PR_CAP_AMBIENT_LOWER 3
PR_CAP_AMBIENT_CLEAR_ALL 4