From patchwork Tue Mar 28 19:47:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 19744 Received: (qmail 22441 invoked by alias); 28 Mar 2017 19:47:59 -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 21152 invoked by uid 89); 28 Mar 2017 19:47:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.2 required=5.0 tests=AWL, 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=basically X-HELO: mail-qt0-f171.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:subject:date:message-id; bh=YG9WjHKfQLOr4D4Pu3KC91vCvv3aNKruN1UFS7i5dUc=; b=b6n1+xKDX91VOQIKm1gd5P809iG8Kmv4ppipCdubAFaN7QjtoYMnEYnYWBgW42FSdQ LWLZ566KKTXJ6TDltkHgCYbM98cfFwBDtcL0JcdWqNiZCurmJiak9YBW9gOX65281oHq Ss9WTnFCnil5XwGALzzIdJezHcCwzsBcR4dagts+b2wQGl7+FEkxn3J5/eh7izqfiLBk 8sr7dZYIKBEKV1UpxkgfdMHzHNzncUNBZ/cfKiJEoyhMw6DCqhnEQ1Gmnyh8wx5c2O7t GX9MjvQaPx54289RMmifyHfoz5sG90ssIm67Cx9xprNW1syj7lIja64+pSmTtDScItsA di1A== X-Gm-Message-State: AFeK/H20ugStOoOnfodjwZQf36WQUDnOKzH66WQ66dxzC7xW1OewMjfpOnR1DhwSqGGEpoQY X-Received: by 10.237.48.228 with SMTP id 91mr15440760qtf.292.1490730476225; Tue, 28 Mar 2017 12:47:56 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] Fix more test-errno issues Date: Tue, 28 Mar 2017 16:47:49 -0300 Message-Id: <1490730469-9562-1-git-send-email-adhemerval.zanella@linaro.org> This patch fixes some test-errno-linux unexpected returns for the tested syscalls on some older kernels (I saw it on a Linux 3.8 on armv7l). Basically: - inotify_add_watch: Linux v3.8 (676a0675c) removed the test to check at least one valid bit in flags (to return EINVAL). It was later added back in v3.9 (04df32fa1). - quotactl: returns ENOSYS for kernels not configured with CONFIG_QUOTA. Checked on x86_64-linux-gnu and armv7l-linux-gnueabihf. * sysdeps/unix/sysv/linux/test-errno-linux.c (do_test): Handle non expected inotify_add_watch and quotactl return. --- ChangeLog | 5 +++++ sysdeps/unix/sysv/linux/test-errno-linux.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/test-errno-linux.c b/sysdeps/unix/sysv/linux/test-errno-linux.c index 03a74bd..87ed103 100644 --- a/sysdeps/unix/sysv/linux/test-errno-linux.c +++ b/sysdeps/unix/sysv/linux/test-errno-linux.c @@ -147,7 +147,10 @@ do_test (void) fails |= test_wrp (EBADF, fdatasync, -1); fails |= test_wrp (EBADF, flock, -1, LOCK_SH); fails |= test_wrp (ESRCH, getpgid, -1); - fails |= test_wrp (EINVAL, inotify_add_watch, -1, "/", 0); + /* Linux v3.8 (676a0675c) removed the test to check at least one valid + bit in flags (to return EINVAL). It was later added back in v3.9 + (04df32fa1). */ + fails |= test_wrp2 (EINVAL, EBADF, inotify_add_watch, -1, "/", 0); fails |= test_wrp (EINVAL, mincore, (void *) -1, 0, vec); /* mlock fails if the result of the addition addr+len was less than addr (which indicates final address overflow), however on 32 bits binaries @@ -157,7 +160,9 @@ do_test (void) fails |= test_wrp2 (EINVAL, ENOMEM, mlock, (void *) -1, 1); fails |= test_wrp (EINVAL, nanosleep, &ts, &ts); fails |= test_wrp (EINVAL, poll, &pollfd, -1, 0); - fails |= test_wrp (ENODEV, quotactl, Q_GETINFO, NULL, -1, (caddr_t) &dqblk); + /* quotactl returns ENOSYS for kernels not configured with CONFIG_QUOTA. */ + fails |= test_wrp2 (ENODEV, ENOSYS, quotactl, Q_GETINFO, NULL, -1, + (caddr_t) &dqblk); fails |= test_wrp (EINVAL, sched_getparam, -1, &sch_param); fails |= test_wrp (EINVAL, sched_getscheduler, -1); fails |= test_wrp (EINVAL, sched_get_priority_max, -1);