diff options
author | Renato Botelho <renato@netgate.com> | 2016-07-19 11:28:42 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-07-19 11:28:42 -0300 |
commit | d672f772561b19a87633a38b63c9b6b9ee457a3e (patch) | |
tree | ddb56ff0f93f58cbbbe2e088659df322eeb91960 /sys/compat/linux/linux_misc.c | |
parent | 0a721af42b1b08f07aac9419590a4906d5b1e8f8 (diff) | |
parent | 9a5d5ad86e4479378293a6598ce3e086d8abf1a8 (diff) | |
download | FreeBSD-src-d672f772561b19a87633a38b63c9b6b9ee457a3e.zip FreeBSD-src-d672f772561b19a87633a38b63c9b6b9ee457a3e.tar.gz |
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 01fd25a..e61d363 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1200,15 +1200,23 @@ linux_mknodat(struct thread *td, struct linux_mknodat_args *args) int linux_personality(struct thread *td, struct linux_personality_args *args) { + struct linux_pemuldata *pem; + struct proc *p = td->td_proc; + uint32_t old; + #ifdef DEBUG if (ldebug(personality)) - printf(ARGS(personality, "%lu"), (unsigned long)args->per); + printf(ARGS(personality, "%u"), args->per); #endif - if (args->per != 0) - return (EINVAL); - /* Yes Jim, it's still a Linux... */ - td->td_retval[0] = 0; + PROC_LOCK(p); + pem = pem_find(p); + old = pem->persona; + if (args->per != 0xffffffff) + pem->persona = args->per; + PROC_UNLOCK(p); + + td->td_retval[0] = old; return (0); } |