From patchwork Mon Oct 17 13:24:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9379287 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0C94607D4 for ; Mon, 17 Oct 2016 13:34:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E33A428B03 for ; Mon, 17 Oct 2016 13:34:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D74E829380; Mon, 17 Oct 2016 13:34:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B23862937E for ; Mon, 17 Oct 2016 13:34:32 +0000 (UTC) Received: from localhost ([::1]:33093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw83j-0002Of-Kf for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Oct 2016 09:34:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw7uP-00036J-Or for qemu-devel@nongnu.org; Mon, 17 Oct 2016 09:24:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw7uO-0003Ba-RD for qemu-devel@nongnu.org; Mon, 17 Oct 2016 09:24:53 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:35816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bw7uO-0003Al-J3 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 09:24:52 -0400 Received: by mail-lf0-x22a.google.com with SMTP id l131so242724137lfl.2 for ; Mon, 17 Oct 2016 06:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PvOi65ZSh4teBb+m6/mPAAwR/I2cinFeCFmy4dZauv8=; b=k2FCp8ZD3D67rlQYDrvcs6/iqU/OZPmJ0KJgINQqW0E2UQOJZfL2V7dozQKKigyc1R P7SQdWdLxgqif+jxEonItbmOHmzqjTaFAfws8xNgyle7knKTWKfHIkQhAxWgu/yfzaNm SyuwM7tLgZOeL9EphkFz//s7odTNSQZOi+GPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PvOi65ZSh4teBb+m6/mPAAwR/I2cinFeCFmy4dZauv8=; b=DkWRISXQcj+6PHr0hF3ZeuIJKWbdf4JKyQKm+I3OosbA+UvkuXYfSByoQfYqGgPlwY ACDvCr1abVRsv/f/VCxvxXAuPknN2/tT6NHNGOA+gdlWv3PPWKrdhhdSXx4ZPvXxs0Hw Cf329Lyv0DKSMk2wAqwNdAtwHmcHZaZIuXC6UjHcDwhOTdaVzt1w8dbLggY9sx/mnYMY ZUsNwpadyNok0fkaCVUPjLFA1hIgx+8eedTkybQeoZSv0cB8heviFHGaz1kvFaPhBhPe U8uZimtVZD2YcORSbvrhrFGMbdKXicvaRFVOQQh4amAByXRiqrhrFcEZtPYlgbAgyrK3 HFWw== X-Gm-Message-State: AA6/9RkFBq7BeAS+/hexeBETsREDlR8MmEV5kr0bsNoBQtqZWCXCJWT8zFTO9Gi34n+xW9sn X-Received: by 10.25.21.233 with SMTP id 102mr15246178lfv.77.1476710687743; Mon, 17 Oct 2016 06:24:47 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id y81sm7782857lff.29.2016.10.17.06.24.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 06:24:46 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 17 Oct 2016 16:24:22 +0300 Message-Id: <3d7a16fa0fb5e8640e14bf845195d1df13dc99f7.1476710352.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22a Subject: [Qemu-devel] [PULL 04/22] linux-user: Fix msgrcv() and msgsnd() syscalls support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Markovic Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Aleksandar Markovic If syscalls msgrcv() and msgsnd() fail, they return E2BIG, EACCES, EAGAIN, EFAULT, EIDRM, EINTR, EINVAL, ENOMEM, or ENOMSG. By examining negative scenarios of these syscalls for Mips, it was established that ENOMSG does not have the same value accross all platforms, but it is nevertheless not included for conversion in the correspondant conversion table defined in linux-user/syscall.c. This is certainly a bug, since it leads to the incorrect emulation of msgrcv() and msgsnd() for scenarios involving ENOMSG. This patch fixes this by extending the conversion table to include ENOMSG. Also, LTP test msgrcv04 will be fixed for some platforms. Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e031ecf..032cb76 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -790,6 +790,9 @@ static uint16_t host_to_target_errno_table[ERRNO_TABLE_SIZE] = { #ifdef ENOTRECOVERABLE [ENOTRECOVERABLE] = TARGET_ENOTRECOVERABLE, #endif +#ifdef ENOMSG + [ENOMSG] = TARGET_ENOMSG, +#endif }; static inline int host_to_target_errno(int err)