diff options
author | Richard Henderson <rth@twiddle.net> | 2012-09-15 13:20:46 -0700 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2012-10-12 13:59:25 +0300 |
commit | 3d21d29c32380384e5ee5b804d0b0bf720469d97 (patch) | |
tree | 83bd7f31840cd7150dd1fdda0e824611beb4bbb3 /linux-user | |
parent | f287b2c2d4d20d35880ab6dca44bda0476e67dce (diff) | |
download | qemu-3d21d29c32380384e5ee5b804d0b0bf720469d97.tar.gz qemu-3d21d29c32380384e5ee5b804d0b0bf720469d97.tar.bz2 qemu-3d21d29c32380384e5ee5b804d0b0bf720469d97.zip |
linux-user: Implement gethostname
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/syscall.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 038aefe548..89c74ada23 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8868,6 +8868,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; } #endif +#ifdef TARGET_NR_gethostname + case TARGET_NR_gethostname: + { + char *name = lock_user(VERIFY_WRITE, arg1, arg2, 0); + if (name) { + ret = get_errno(gethostname(name, arg2)); + unlock_user(name, arg1, arg2); + } else { + ret = -TARGET_EFAULT; + } + break; + } +#endif default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); |