diff options
| -rw-r--r-- | include/linux/prctl.h | 7 | ||||
| -rw-r--r-- | kernel/sys.c | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index bf022c43a18e..52a9be41250d 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
| @@ -52,4 +52,11 @@ | |||
| 52 | #define PR_SET_NAME 15 /* Set process name */ | 52 | #define PR_SET_NAME 15 /* Set process name */ |
| 53 | #define PR_GET_NAME 16 /* Get process name */ | 53 | #define PR_GET_NAME 16 /* Get process name */ |
| 54 | 54 | ||
| 55 | /* Get/set process endian */ | ||
| 56 | #define PR_GET_ENDIAN 19 | ||
| 57 | #define PR_SET_ENDIAN 20 | ||
| 58 | # define PR_ENDIAN_BIG 0 | ||
| 59 | # define PR_ENDIAN_LITTLE 1 /* True little endian mode */ | ||
| 60 | # define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ | ||
| 61 | |||
| 55 | #endif /* _LINUX_PRCTL_H */ | 62 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/kernel/sys.c b/kernel/sys.c index 0b6ec0e7936f..12d2d753dc3b 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
| @@ -57,6 +57,12 @@ | |||
| 57 | #ifndef GET_FPEXC_CTL | 57 | #ifndef GET_FPEXC_CTL |
| 58 | # define GET_FPEXC_CTL(a,b) (-EINVAL) | 58 | # define GET_FPEXC_CTL(a,b) (-EINVAL) |
| 59 | #endif | 59 | #endif |
| 60 | #ifndef GET_ENDIAN | ||
| 61 | # define GET_ENDIAN(a,b) (-EINVAL) | ||
| 62 | #endif | ||
| 63 | #ifndef SET_ENDIAN | ||
| 64 | # define SET_ENDIAN(a,b) (-EINVAL) | ||
| 65 | #endif | ||
| 60 | 66 | ||
| 61 | /* | 67 | /* |
| 62 | * this is where the system-wide overflow UID and GID are defined, for | 68 | * this is where the system-wide overflow UID and GID are defined, for |
| @@ -2057,6 +2063,13 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
| 2057 | return -EFAULT; | 2063 | return -EFAULT; |
| 2058 | return 0; | 2064 | return 0; |
| 2059 | } | 2065 | } |
| 2066 | case PR_GET_ENDIAN: | ||
| 2067 | error = GET_ENDIAN(current, arg2); | ||
| 2068 | break; | ||
| 2069 | case PR_SET_ENDIAN: | ||
| 2070 | error = SET_ENDIAN(current, arg2); | ||
| 2071 | break; | ||
| 2072 | |||
| 2060 | default: | 2073 | default: |
| 2061 | error = -EINVAL; | 2074 | error = -EINVAL; |
| 2062 | break; | 2075 | break; |
