From patchwork Tue Oct 18 13:21:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 78033 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp884100qge; Tue, 18 Oct 2016 06:24:35 -0700 (PDT) X-Received: by 10.55.212.85 with SMTP id l82mr480720qki.214.1476797075004; Tue, 18 Oct 2016 06:24:35 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g5si20358657qkf.111.2016.10.18.06.24.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 18 Oct 2016 06:24:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwUNe-0007Pc-F3 for patch@linaro.org; Tue, 18 Oct 2016 09:24:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwULB-0006E2-4z for qemu-devel@nongnu.org; Tue, 18 Oct 2016 09:22:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwUL9-0000dD-Qd for qemu-devel@nongnu.org; Tue, 18 Oct 2016 09:22:01 -0400 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]:35880) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwUL9-0000ca-Iy for qemu-devel@nongnu.org; Tue, 18 Oct 2016 09:21:59 -0400 Received: by mail-lf0-x231.google.com with SMTP id b75so346718078lfg.3 for ; Tue, 18 Oct 2016 06:21:59 -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=YJlxhcw4E9fVnj4mtB0/kTPuzm4xBNLezntcB2KRKBXT2ki+riz+UWCTZQu94Hr7Br 6H/XniPefVOi82K9SIeeBRBlWCqs7m+GAg4ckK3vXjv05DzVRghngYo0EOoqcMfa7sU7 h5LLD/xBWqH6lE+U6978c8v/UaW/TcnjXqSS4= 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=Z90/wJvUad+A+lxZHP05dj+HBflbqZhPRDKQFIZ0JesOe3MzkSSi1yz6DAn6OPsrJs 1PnjNUhtOQMVVBe5nSV7AEQEcbeAeVOLYo8eOKQvC42KxSUMwR4gvkACTiXcRHL+XEl0 KRM2++8uTQlhDguWEWCRKLZVK7xnFx+vjxbLmmPV+AjjFDXGTG2nu0mTbPEF52kfRnSK V3aTOF7DWBOPC1Y+Fb4UloDiIUbvba1V+EdvXEdSlGNHdGl/NMQv1kxo+6a54Uy0rRH9 tsmHQieOCw4V9KYDOWe/c1gxnUQZ/m8O0jp4rLsFeyyEwxTwXYMtbnRqSXH8qucG3mNc ippg== X-Gm-Message-State: AA6/9RmNL4PpU1NVGcPYvN9wq2VtN4RLnN5yRG+ZS5oKyad7r1ztArQbfGTPu2ZX5UTs27o9 X-Received: by 10.25.201.137 with SMTP id z131mr584255lff.144.1476796916980; Tue, 18 Oct 2016 06:21:56 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id 201sm9535359ljf.48.2016.10.18.06.21.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Oct 2016 06:21:56 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 18 Oct 2016 16:21:32 +0300 Message-Id: <3d7a16fa0fb5e8640e14bf845195d1df13dc99f7.1476796525.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::231 Subject: [Qemu-devel] [PULL v2 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(+) -- 2.1.4 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)