linux-user: Use direct syscalls for setuid(), etc
commitfd6f7798ac3066ad9e3956defd37521830197666
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 1 Mar 2016 16:33:02 +0000 (1 16:33 +0000)
committerRiku Voipio <riku.voipio@linaro.org>
Fri, 27 May 2016 11:50:39 +0000 (27 14:50 +0300)
tree664c46d6a83404b5556d66b8e10f0d30e2d333a6
parent716f3fbef26b583d207f8b7c98cadfa9dda69c6b
linux-user: Use direct syscalls for setuid(), etc

On Linux the setuid(), setgid(), etc system calls have different semantics
from the libc functions. The libc functions follow POSIX and update the
credentials for all threads in the process; the system calls update only
the thread which makes the call. (This impedance mismatch is worked around
in libc by signalling all threads to tell them to do a syscall, in a
byzantine and fragile way; see http://ewontfix.com/17/.)

Since in linux-user we are trying to emulate the system call semantics,
we must implement all these syscalls to directly call the underlying
host syscall, rather than calling the host libc function.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c