From 6e6d7674487a806fc16ce160a2c3a0b246401afb Mon Sep 17 00:00:00 2001 From: Doug Ledford Date: Sun, 17 Aug 2003 05:29:33 -0400 Subject: [PATCH] Reserve the sys_prctl() numbers for and add the stub for allowing programs to select whether they use statistical time accounting or accurate timestamp based accounting. --- include/linux/prctl.h | 10 ++++++++++ kernel/sys.c | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/linux/prctl.h b/include/linux/prctl.h index 2cc14f5e53961..f9bfac9529889 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h @@ -34,4 +34,14 @@ # define PR_FP_EXC_ASYNC 2 /* async recoverable exception mode */ # define PR_FP_EXC_PRECISE 3 /* precise exception mode */ +/* Get/set whether we use statistical process timing or accurate timestamp + * based process timing */ +#define PR_GET_TIMING 13 +#define PR_SET_TIMING 14 +# define PR_TIMING_STATISTICAL 0 /* Normal, traditional, + statistical process timing */ +# define PR_TIMING_TIMESTAMP 1 /* Accurate timestamp based + process timing */ + + #endif /* _LINUX_PRCTL_H */ diff --git a/kernel/sys.c b/kernel/sys.c index 0bd0c5a399a6f..3497a1565a618 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1399,7 +1399,15 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, case PR_GET_FPEXC: error = GET_FPEXC_CTL(current, arg2); break; - + case PR_GET_TIMING: + error = PR_TIMING_STATISTICAL; + break; + case PR_SET_TIMING: + if (arg2 == PR_TIMING_STATISTICAL) + error = 0; + else + error = -EINVAL; + break; case PR_GET_KEEPCAPS: if (current->keep_capabilities) -- 2.53.0