]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: Implement gethostname
authorRichard Henderson <rth@twiddle.net>
Sat, 15 Sep 2012 20:20:46 +0000 (13:20 -0700)
committerRiku Voipio <riku.voipio@linaro.org>
Fri, 12 Oct 2012 10:59:25 +0000 (13:59 +0300)
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>
linux-user/syscall.c

index 038aefe5486f8c866c00e1acbf2f50ea282c4f5d..89c74ada237ce113d9c19a2c41410142fdb15e19 100644 (file)
@@ -8867,6 +8867,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: