Commit feef9b8a authored by David Mosberger's avatar David Mosberger Committed by Linus Torvalds

[PATCH] prctl() patch

This is the patch to add support for PR_SET_FPEMU/PR_GET_FPEMU to give
per-process control over fp-emulation handling.  It also cleans up the
way PR_SET_UNALIGN_CTL/PR_GET_UNALIGN_CTL are implemented.
parent c6df0ff4
...@@ -20,4 +20,10 @@ ...@@ -20,4 +20,10 @@
#define PR_GET_KEEPCAPS 7 #define PR_GET_KEEPCAPS 7
#define PR_SET_KEEPCAPS 8 #define PR_SET_KEEPCAPS 8
/* Get/set floating-point emulation control bits (if meaningful) */
#define PR_GET_FPEMU 9
#define PR_SET_FPEMU 10
# define PR_FPEMU_NOPRINT 1 /* silently emulate fp operations accesses */
# define PR_FPEMU_SIGFPE 2 /* don't emulate fp operations, send SIGFPE instead */
#endif /* _LINUX_PRCTL_H */ #endif /* _LINUX_PRCTL_H */
...@@ -21,6 +21,19 @@ ...@@ -21,6 +21,19 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#ifndef SET_UNALIGN_CTL
# define SET_UNALIGN_CTL(a,b) (-EINVAL)
#endif
#ifndef GET_UNALIGN_CTL
# define GET_UNALIGN_CTL(a,b) (-EINVAL)
#endif
#ifndef SET_FPEMU_CTL
# define SET_FPEMU_CTL(a,b) (-EINVAL)
#endif
#ifndef GET_FPEMU_CTL
# define GET_FPEMU_CTL(a,b) (-EINVAL)
#endif
/* /*
* this is where the system-wide overflow UID and GID are defined, for * this is where the system-wide overflow UID and GID are defined, for
* architectures that now have 32-bit UID/GID but didn't in the past * architectures that now have 32-bit UID/GID but didn't in the past
...@@ -1240,20 +1253,18 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, ...@@ -1240,20 +1253,18 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
} }
current->mm->dumpable = arg2; current->mm->dumpable = arg2;
break; break;
case PR_SET_UNALIGN:
#ifdef SET_UNALIGN_CTL case PR_SET_UNALIGN:
error = SET_UNALIGN_CTL(current, arg2); error = SET_UNALIGN_CTL(current, arg2);
#else
error = -EINVAL;
#endif
break; break;
case PR_GET_UNALIGN:
case PR_GET_UNALIGN:
#ifdef GET_UNALIGN_CTL
error = GET_UNALIGN_CTL(current, arg2); error = GET_UNALIGN_CTL(current, arg2);
#else break;
error = -EINVAL; case PR_SET_FPEMU:
#endif error = SET_FPEMU_CTL(current, arg2);
break;
case PR_GET_FPEMU:
error = GET_FPEMU_CTL(current, arg2);
break; break;
case PR_GET_KEEPCAPS: case PR_GET_KEEPCAPS:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment