diff options
author | Renato Botelho <renato@netgate.com> | 2016-07-19 11:28:18 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-07-19 11:28:18 -0300 |
commit | a3c20a378f7a9fa76e9301a43ac64ed07057d01e (patch) | |
tree | d14045c61b471f327f487431e05b0c4fe0cd8d76 /sys/compat/linux/linux_misc.c | |
parent | 3a4027cfafa37c1a0c0b05987c0edb1452c7bd2b (diff) | |
parent | 3f1f4f0e73b6d12c01e8cad4791d23e8e56127db (diff) | |
download | FreeBSD-src-a3c20a378f7a9fa76e9301a43ac64ed07057d01e.zip FreeBSD-src-a3c20a378f7a9fa76e9301a43ac64ed07057d01e.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
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 cb2379a5..2765dfd 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1198,15 +1198,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); } |