From patchwork Fri Sep 21 14:17:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185743 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 D73C32C0085 for ; Sat, 22 Sep 2012 00:18:04 +1000 (EST) Received: from localhost ([::1]:46907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF43O-0000jw-M0 for incoming@patchwork.ozlabs.org; Fri, 21 Sep 2012 10:18:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF42s-0000Aj-Hu for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:17:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF42m-0002h9-CS for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:17:30 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:57956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF42m-0002gX-6X for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:17:24 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp12so7780255pbb.4 for ; Fri, 21 Sep 2012 07:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=zpTMEXA9Ri6iPWjPW+y3sykdMyeJuvqSoIs3vC5ZHHs=; b=YvPObCgu8wCFtJRRPCHvPB+woq24Jet1pg6NR6VSdrEFqO5ary5b2yxf+L06CII8TE pHTSRoZCCnBRt1d6l68NUEmU7Id35xHGHsGfo6PNa9OuksFMYbJXxn92fASY4vOMcux7 /RoBzy5vRo3e/TG7BsFYQ23Mu3UyXW94hbn1a5pEIWdwtcv9hpmsSNWVS9bIE+QNrj6u Z9SDJ/BTQu6fuS2crGjgW8jVQG6Hef6XT9SL5U4NEjDY8qeYcYOJRUHjIM/1waea7o7n G/HSuyFAP4R9oUn8ROJwSVJzIwVIshKQ0KWlYTRQvtUxYsNxe2q9+5MBn0M5olREKEpg a1pQ== Received: by 10.68.221.70 with SMTP id qc6mr16226887pbc.92.1348237043849; Fri, 21 Sep 2012 07:17:23 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id vf8sm5204020pbc.27.2012.09.21.07.17.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 07:17:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2012 07:17:10 -0700 Message-Id: <1348237034-15851-3-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348237034-15851-1-git-send-email-rth@twiddle.net> References: <1348237034-15851-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 2/6] 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 Signed-off-by: Richard Henderson --- linux-user/syscall.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ceca04c..925e579 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8866,6 +8866,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);