diff options
| -rw-r--r-- | include/linux/prctl.h | 8 | ||||
| -rw-r--r-- | kernel/sys.c | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index bbe6c00bfbd3..2cc14f5e5396 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h @@ -26,4 +26,12 @@ # define PR_FPEMU_NOPRINT 1 /* silently emulate fp operations accesses */ # define PR_FPEMU_SIGFPE 2 /* don't emulate fp operations, send SIGFPE instead */ +/* Get/set floating-point exception mode (if meaningful) */ +#define PR_GET_FPEXC 11 +#define PR_SET_FPEXC 12 +# define PR_FP_EXC_DISABLED 0 /* FP exceptions disabled */ +# define PR_FP_EXC_NONRECOV 1 /* async non-recoverable exc. mode */ +# define PR_FP_EXC_ASYNC 2 /* async recoverable exception mode */ +# define PR_FP_EXC_PRECISE 3 /* precise exception mode */ + #endif /* _LINUX_PRCTL_H */ diff --git a/kernel/sys.c b/kernel/sys.c index 316a63de74ea..8a6d5da46335 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -37,6 +37,12 @@ #ifndef GET_FPEMU_CTL # define GET_FPEMU_CTL(a,b) (-EINVAL) #endif +#ifndef SET_FPEXC_CTL +# define SET_FPEXC_CTL(a,b) (-EINVAL) +#endif +#ifndef GET_FPEXC_CTL +# define GET_FPEXC_CTL(a,b) (-EINVAL) +#endif /* * this is where the system-wide overflow UID and GID are defined, for @@ -1283,6 +1289,13 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, case PR_GET_FPEMU: error = GET_FPEMU_CTL(current, arg2); break; + case PR_SET_FPEXC: + error = SET_FPEXC_CTL(current, arg2); + break; + case PR_GET_FPEXC: + error = GET_FPEXC_CTL(current, arg2); + break; + case PR_GET_KEEPCAPS: if (current->keep_capabilities) |
