From patchwork Sun Jul 5 17:26:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 39914 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9630A3857000; Sun, 5 Jul 2020 17:26:48 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id EB7773858D38 for ; Sun, 5 Jul 2020 17:26:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EB7773858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 3731B258B; Sun, 5 Jul 2020 19:26:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R9Lbclyvdd4B; Sun, 5 Jul 2020 19:26:42 +0200 (CEST) Received: from function (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 75B351E6D; Sun, 5 Jul 2020 19:26:42 +0200 (CEST) Received: from samy by function with local (Exim 4.94) (envelope-from ) id 1js8PY-005p0u-Tf; Sun, 05 Jul 2020 19:26:40 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited] tst-cancel4: deal with ENOSYS errors Date: Sun, 5 Jul 2020 19:26:40 +0200 Message-Id: <20200705172640.1387695-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The Hurd port doesn't have support for sigwaitinfo, sigtimedwait, and msgget yet, so let us ignore the test for these when they return ENOSYS. * nptl/tst-cancel4.c (tf_sigwaitinfo): Fallback on sigwait when sigwaitinfo returns ENOSYS. (tf_sigtimedwait): Likewise with sigtimedwait. (tf_msgrcv, tf_msgsnd): Fallback on tf_usleep when msgget returns ENOSYS. --- nptl/tst-cancel4.c | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c index be7a48e253..5250a30b2e 100644 --- a/nptl/tst-cancel4.c +++ b/nptl/tst-cancel4.c @@ -607,7 +607,15 @@ tf_sigwaitinfo (void *arg) pthread_cleanup_push (cl, NULL); /* Wait for SIGUSR1. */ - sigwaitinfo (&mask, &info); + int ret; + ret = sigwaitinfo (&mask, &info); + if (ret == -1 && errno == ENOSYS) + { + int sig; + + printf ("sigwaitinfo not supported\n"); + sigwait (&mask, &sig); + } pthread_cleanup_pop (0); @@ -634,7 +642,15 @@ tf_sigtimedwait (void *arg) struct timespec ts = { .tv_sec = 60, .tv_nsec = 0 }; pthread_cleanup_push (cl, NULL); - sigtimedwait (&mask, &info, &ts); + int ret; + ret = sigtimedwait (&mask, &info, &ts); + if (ret == -1 && errno == ENOSYS) + { + int sig; + printf ("sigtimedwait not supported\n"); + + sigwait (&mask, &sig); + } pthread_cleanup_pop (0); @@ -1459,7 +1475,16 @@ tf_msgrcv (void *arg) { tempmsg = msgget (IPC_PRIVATE, 0666 | IPC_CREAT); if (tempmsg == -1) - FAIL_EXIT1 ("msgget (IPC_PRIVATE, 0666 | IPC_CREAT): %m"); + { + if (errno == ENOSYS) + { + printf ("msgget not supported\n"); + tf_usleep (arg); + pthread_exit (NULL); + } + else + FAIL_EXIT1 ("msgget (IPC_PRIVATE, 0666 | IPC_CREAT): %m"); + } xpthread_barrier_wait (&b2); @@ -1505,7 +1530,16 @@ tf_msgsnd (void *arg) tempmsg = msgget (IPC_PRIVATE, 0666 | IPC_CREAT); if (tempmsg == -1) - FAIL_EXIT1 ("msgget (IPC_PRIVATE, 0666 | IPC_CREAT): %m"); + { + if (errno == ENOSYS) + { + printf ("msgget not supported\n"); + tf_usleep (arg); + pthread_exit (NULL); + } + else + FAIL_EXIT1 ("msgget (IPC_PRIVATE, 0666 | IPC_CREAT): %m"); + } xpthread_barrier_wait (&b2);