From patchwork Mon Jul 17 14:29:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 107966 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4590894qge; Mon, 17 Jul 2017 07:30:09 -0700 (PDT) X-Received: by 10.99.112.91 with SMTP id a27mr12833254pgn.151.1500301809701; Mon, 17 Jul 2017 07:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500301809; cv=none; d=google.com; s=arc-20160816; b=WjBFr6r74H00NMfwy7sBWuomOuLIb0oatExxOmUuXPkxVkfMTS1FUMHCI5juJXqpUA rK4SPIUid0UygGXMZCVhQ9t6dKDWzEYPVg0a0OQDqR8h9UTXld5CcXNv8/dkg09iPYag mTraQg1wNy5hwZAVERMWc0aocgQzCdQy2KMbDac5TG/3qCuG8eqXsYxkHWOSJJfRAtJ2 XjFzFhmlKzC+dIySOZ80i7D5cGEzLHz6MnYwsDXVdgeQDjIU2EQgeYYTXVEPjTH+BljW y86QcANmlO6VdJTNOB3ztZPv/TW1QDphhY+ZvS96sb0WBy+oeqLWYmlxY8QkQLayOlDG v4Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=d6lihcIhedUpAWY/q746X5XWsFudXEFsy4g1JKeU0Lg=; b=Id0njlxwhrVltCyc8x/IJLUR9lXpJww7hx0J67UfTinS2VDoqAuiqhlO2u+/pJQ4yR LnIhBg+QJEGRMJFqvE+5MZr77jju+F2EwBlzLuKEmOYBHomQ1tX/JwpYHHn3UripgtGR 4D9V8LAgI/lN6FB98dj1M4N6ZS743BXJJkmlQsWBylkBqRB3KbuKC8en6dJ+tNEBTZ32 ws8jSZhxUfHtJ7HASHAw5X1tNUKUk+6EfLjslSV8ZNU0q8GDTipj6hzRmxi8bLiuAXf7 etAmVTPdWANrf32WKKkKBQZde1f9hh9jpU5vPFMX1uIQ/kLJeRXbWyyVv5Q9Cy9O9rWd kCAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.b=X1CQUEmx; spf=pass (google.com: domain of libc-alpha-return-82156-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-82156-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u1si13341663plk.370.2017.07.17.07.30.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 07:30:09 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-82156-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.b=X1CQUEmx; spf=pass (google.com: domain of libc-alpha-return-82156-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-82156-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=ww1PhGC6e0TbQbGF4oLk4rVMBAFuUNP6a38WlsyZMdXKw1D57nb71 joXbJuMJtGKU6gSzmVSkC66SEguq8g5HavOyVPf1jrJBz33vL+cuEOy1jI3MC7ba fqm3N6MsCv6SymdgPbCFNR3KbKXDlyktatOgux7PNH2ZURAASJ0KrY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=Bjwk9T0UVbxPhfImMzKAPE6piAc=; b=X1CQUEmxXssOarCZo9DdegkIbsvk cBEbUYyV2ad5pSaP+ActbAAuTAsEMyFJPU+o+mq/ijXT7oOjc0dtJHtMy25k58zR JmkvywxtomIihD8/POksTSdJvGO7PwWS7iEutebjwWYcNi/GjUFhBEB4BqsNTNzA 8Dg927jiha87JLU= Received: (qmail 120887 invoked by alias); 17 Jul 2017 14:29:58 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 119069 invoked by uid 89); 17 Jul 2017 14:29:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=H*p:D*org X-HELO: mail-qk0-f172.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=d6lihcIhedUpAWY/q746X5XWsFudXEFsy4g1JKeU0Lg=; b=QG2j/QuS4mL+b4W/VQ9NWYrYYWZvfDvZQKfbdY2Hnvj+J1H8DwtoO5yrFEYAHb3i90 x+PBLRFsLtwCDCIWYk/Dw3KyUYzStQekkRUH+rgoo9KbTJLd60sd3jaraHDr+085uenp Qeh6M41tLApF7je7MAK6a8Dl3PaMZWy2Qh5Adj6c4kN2h8z8otT+PsQ29UN0VSNyk6fF /K/IQeMbil0SXEVPL0PqGP3Dx6drukFM2eaUKAXW6tewkiVVmD1u4VX+Q8D42oHU6Dnv BmHMgqA2pB0+Dzn5LbBbQ/rSvzP4Nphs5i95bZhAqKtQyvaMu0uZTu2C5f2Q9HRhHyPu BCgg== X-Gm-Message-State: AIVw110myqw2LtbYpFWVrZEXOlOUOBK+Sga3KD7kSOp58mD2gQl+oYQ0 SuG5gN48WrW61o/moa69LQ== X-Received: by 10.55.17.198 with SMTP id 67mr29416426qkr.42.1500301792063; Mon, 17 Jul 2017 07:29:52 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: John David Anglin Subject: [PATCH] posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780) Date: Mon, 17 Jul 2017 11:29:47 -0300 Message-Id: <1500301787-25312-1-git-send-email-adhemerval.zanella@linaro.org> Different than other architectures hppa-linux-gnu define different values for ENOTSUP and EOPNOTSUPP, where the later is a Linux specific one. This leads to tst-preadwritev{64}v2 tests failures: $ ./testrun.sh misc/tst-preadvwritev2 error: tst-preadvwritev2-common.c:35: preadv2 failure did not set errno to ENOTSUP (223) error: 1 test failures The straightforward fix is to return the POSIX defined ENOTSUP on all p{read,write}v{64}v2 implementations intead of Linux specific one. Checked on x86_64-linux-gnu and the tst-preadwritev{64}v2 on hppa-linux-gnu (although due the installed kernel on my testing system the pwritev{64}v2 with an invalid flag still fails due a known kernel issue [1]). [BZ #21780] * sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of EOPNOTSUPP. * sysdeps/posix/preadv64v2.c (preadv64v2): Likewise. * sysdeps/posix/pwritev2.c (pwritev2): Likewise. * sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise. * sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise. * sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise. * sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise. * sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise. [1] https://sourceware.org/ml/libc-alpha/2017-06/msg00726.html --- ChangeLog | 13 +++++++++++++ sysdeps/posix/preadv2.c | 2 +- sysdeps/posix/preadv64v2.c | 2 +- sysdeps/posix/pwritev2.c | 2 +- sysdeps/posix/pwritev64v2.c | 2 +- sysdeps/unix/sysv/linux/preadv2.c | 4 ++-- sysdeps/unix/sysv/linux/preadv64v2.c | 4 ++-- sysdeps/unix/sysv/linux/pwritev2.c | 4 ++-- sysdeps/unix/sysv/linux/pwritev64v2.c | 4 ++-- 9 files changed, 25 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/sysdeps/posix/preadv2.c b/sysdeps/posix/preadv2.c index 2a7cf11..d27f702 100644 --- a/sysdeps/posix/preadv2.c +++ b/sysdeps/posix/preadv2.c @@ -28,7 +28,7 @@ preadv2 (int fd, const struct iovec *vector, int count, OFF_T offset, { if (flags != 0) { - __set_errno (EOPNOTSUPP); + __set_errno (ENOTSUP); return -1; } diff --git a/sysdeps/posix/preadv64v2.c b/sysdeps/posix/preadv64v2.c index e084f3f..ce7cb40 100644 --- a/sysdeps/posix/preadv64v2.c +++ b/sysdeps/posix/preadv64v2.c @@ -25,7 +25,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, OFF_T offset, { if (flags != 0) { - __set_errno (EOPNOTSUPP); + __set_errno (ENOTSUP); return -1; } diff --git a/sysdeps/posix/pwritev2.c b/sysdeps/posix/pwritev2.c index 5b7650c..7ec8cbc 100644 --- a/sysdeps/posix/pwritev2.c +++ b/sysdeps/posix/pwritev2.c @@ -28,7 +28,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, OFF_T offset, { if (flags != 0) { - __set_errno (EOPNOTSUPP); + __set_errno (ENOTSUP); return -1; } diff --git a/sysdeps/posix/pwritev64v2.c b/sysdeps/posix/pwritev64v2.c index 0f2f9ef..be98aee 100644 --- a/sysdeps/posix/pwritev64v2.c +++ b/sysdeps/posix/pwritev64v2.c @@ -26,7 +26,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, OFF_T offset, { if (flags != 0) { - __set_errno (EOPNOTSUPP); + __set_errno (ENOTSUP); return -1; } diff --git a/sysdeps/unix/sysv/linux/preadv2.c b/sysdeps/unix/sysv/linux/preadv2.c index 11fe85e..137e2dd 100644 --- a/sysdeps/unix/sysv/linux/preadv2.c +++ b/sysdeps/unix/sysv/linux/preadv2.c @@ -32,7 +32,7 @@ preadv2 (int fd, const struct iovec *vector, int count, off_t offset, # ifdef __NR_preadv2 ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count, LO_HI_LONG (offset), flags); - if (result >= 0 || errno != ENOSYS) + if (result >= 0) return result; # endif /* Trying to emulate the preadv2 syscall flags is troublesome: @@ -46,7 +46,7 @@ preadv2 (int fd, const struct iovec *vector, int count, off_t offset, if (flags != 0) { - __set_errno (EOPNOTSUPP); + __set_errno (ENOTSUP); return -1; } return preadv (fd, vector, count, offset); diff --git a/sysdeps/unix/sysv/linux/preadv64v2.c b/sysdeps/unix/sysv/linux/preadv64v2.c index 9d7f8c9..8f41325 100644 --- a/sysdeps/unix/sysv/linux/preadv64v2.c +++ b/sysdeps/unix/sysv/linux/preadv64v2.c @@ -30,7 +30,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset, #ifdef __NR_preadv64v2 ssize_t result = SYSCALL_CANCEL (preadv64v2, fd, vector, count, LO_HI_LONG (offset), flags); - if (result >= 0 || errno != ENOSYS) + if (result >= 0) return result; #endif /* Trying to emulate the preadv2 syscall flags is troublesome: @@ -44,7 +44,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset, if (flags != 0) { - __set_errno (EOPNOTSUPP); + __set_errno (ENOTSUP); return -1; } return preadv64 (fd, vector, count, offset); diff --git a/sysdeps/unix/sysv/linux/pwritev2.c b/sysdeps/unix/sysv/linux/pwritev2.c index 72f0471..8e5032f 100644 --- a/sysdeps/unix/sysv/linux/pwritev2.c +++ b/sysdeps/unix/sysv/linux/pwritev2.c @@ -28,7 +28,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, off_t offset, # ifdef __NR_pwritev2 ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count, LO_HI_LONG (offset), flags); - if (result >= 0 || errno != ENOSYS) + if (result >= 0) return result; # endif /* Trying to emulate the pwritev2 syscall flags is troublesome: @@ -42,7 +42,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, off_t offset, if (flags != 0) { - __set_errno (EOPNOTSUPP); + __set_errno (ENOTSUP); return -1; } return pwritev (fd, vector, count, offset); diff --git a/sysdeps/unix/sysv/linux/pwritev64v2.c b/sysdeps/unix/sysv/linux/pwritev64v2.c index def9a0b..d2800c6 100644 --- a/sysdeps/unix/sysv/linux/pwritev64v2.c +++ b/sysdeps/unix/sysv/linux/pwritev64v2.c @@ -30,7 +30,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset, #ifdef __NR_pwritev64v2 ssize_t result = SYSCALL_CANCEL (pwritev64v2, fd, vector, count, LO_HI_LONG (offset), flags); - if (result >= 0 || errno != ENOSYS) + if (result >= 0) return result; #endif /* Trying to emulate the pwritev2 syscall flags is troublesome: @@ -44,7 +44,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset, if (flags != 0) { - __set_errno (EOPNOTSUPP); + __set_errno (ENOTSUP); return -1; } return pwritev64 (fd, vector, count, offset);