From patchwork Fri Oct 12 12:36:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 191120 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 C72D62C0084 for ; Fri, 12 Oct 2012 23:37:40 +1100 (EST) Received: from localhost ([::1]:57520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMeUk-0001t3-UA for incoming@patchwork.ozlabs.org; Fri, 12 Oct 2012 08:37:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMeTX-0007ia-Sv for qemu-devel@nongnu.org; Fri, 12 Oct 2012 08:36:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMeTS-0004mz-Ik for qemu-devel@nongnu.org; Fri, 12 Oct 2012 08:36:23 -0400 Received: from afflict.kos.to ([92.243.29.197]:49347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMeTS-0004ls-Bm for qemu-devel@nongnu.org; Fri, 12 Oct 2012 08:36:18 -0400 Received: by afflict.kos.to (Postfix, from userid 1000) id 61F21264C7; Fri, 12 Oct 2012 14:36:16 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 12 Oct 2012 15:36:09 +0300 Message-Id: <3d21d29c32380384e5ee5b804d0b0bf720469d97.1350044677.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);