From patchwork Thu Oct 18 11:31:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 192296 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 607652C0097 for ; Thu, 18 Oct 2012 22:31:24 +1100 (EST) Received: from localhost ([::1]:39443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOoJu-0008N8-7z for incoming@patchwork.ozlabs.org; Thu, 18 Oct 2012 07:31:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOoJm-0008Mp-Jr for qemu-devel@nongnu.org; Thu, 18 Oct 2012 07:31:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOoJi-0005VO-Ky for qemu-devel@nongnu.org; Thu, 18 Oct 2012 07:31:14 -0400 Received: from afflict.kos.to ([92.243.29.197]:57390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOoJi-0005V4-DU for qemu-devel@nongnu.org; Thu, 18 Oct 2012 07:31:10 -0400 Received: by afflict.kos.to (Postfix, from userid 1000) id EFDEC264C6; Thu, 18 Oct 2012 13:31:07 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2012 14:31:00 +0300 Message-Id: <3d21d29c32380384e5ee5b804d0b0bf720469d97.1350559608.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 92.243.29.197 Cc: Richard Henderson Subject: [Qemu-devel] [PATCH 04/11] linux-user: Implement gethostname X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/syscall.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 038aefe..89c74ad 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);