From 2a39074226ca61325822442c7e21af2359eb9578 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Wed, 7 Jun 2006 16:10:19 +1000 Subject: [PATCH] --- yaml --- r: 28741 b: refs/heads/master c: 651d765d0b2c72d33430487c8b6ef64c60cd2134 h: refs/heads/master i: 28739: 5b23c73df1fdf767407b94343ca4d20381e2df73 v: v3 --- [refs] | 2 +- trunk/include/linux/prctl.h | 7 +++++++ trunk/kernel/sys.c | 13 +++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e767d2d4c25a..4795443ec2c8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3b5e905ee3bd23e9311951890aba57a0dbc81ca4 +refs/heads/master: 651d765d0b2c72d33430487c8b6ef64c60cd2134 diff --git a/trunk/include/linux/prctl.h b/trunk/include/linux/prctl.h index bf022c43a18e..52a9be41250d 100644 --- a/trunk/include/linux/prctl.h +++ b/trunk/include/linux/prctl.h @@ -52,4 +52,11 @@ #define PR_SET_NAME 15 /* Set process name */ #define PR_GET_NAME 16 /* Get process name */ +/* Get/set process endian */ +#define PR_GET_ENDIAN 19 +#define PR_SET_ENDIAN 20 +# define PR_ENDIAN_BIG 0 +# define PR_ENDIAN_LITTLE 1 /* True little endian mode */ +# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ + #endif /* _LINUX_PRCTL_H */ diff --git a/trunk/kernel/sys.c b/trunk/kernel/sys.c index 0b6ec0e7936f..12d2d753dc3b 100644 --- a/trunk/kernel/sys.c +++ b/trunk/kernel/sys.c @@ -57,6 +57,12 @@ #ifndef GET_FPEXC_CTL # define GET_FPEXC_CTL(a,b) (-EINVAL) #endif +#ifndef GET_ENDIAN +# define GET_ENDIAN(a,b) (-EINVAL) +#endif +#ifndef SET_ENDIAN +# define SET_ENDIAN(a,b) (-EINVAL) +#endif /* * 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, return -EFAULT; return 0; } + case PR_GET_ENDIAN: + error = GET_ENDIAN(current, arg2); + break; + case PR_SET_ENDIAN: + error = SET_ENDIAN(current, arg2); + break; + default: error = -EINVAL; break;