From patchwork Wed Mar 4 23:16:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 446487 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 30E08140142 for ; Thu, 5 Mar 2015 10:16:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=sourceware.org header.i=@sourceware.org header.b=JlZERI0B; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=hE9WwpXAKRIWwbn4cvUMn21I44gL/qKFvXkI9lPn6C2lfQ XFKEusfiNuMven8XiVSK67W8nfYuuAymw2Unp1Emm4GAWkCa/LRTR5jPkzx8cOyZ SMgkT+axerVAK4OHSMWKd8VPWKQ9ZCVt7r9hGOKAwZqQ84tp8Pf2+uqg0H8n0= 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:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=0ndGpmZOKjWP8E9kpGTMAwY+6EA=; b=JlZERI0BPVUj+N1C+ZZl QmOz5eNSxI32M/j62WCxbHsiip27p6eF4rHeqGJnwWIhcV/Ex4jdIFZHpSkH2AWo NFWhmUkowaZ9DnsEP3HkECaSQv5EAgNmeD+nIXiCULlMNceUOwdpPYLC9Sczy2oE 1+ilM8jhDYM8AubWxN5rITY= Received: (qmail 117278 invoked by alias); 4 Mar 2015 23:16:25 -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 117269 invoked by uid 89); 4 Mar 2015 23:16:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] Conditionalize some test code for SIGRTMIN, SA_SIGINFO. Message-Id: <20150304231621.17A532C3B7B@topped-with-meat.com> Date: Wed, 4 Mar 2015 15:16:21 -0800 (PST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=NtXlx9iRq0iMztHszIYA:9 a=MrTCf_IVChyUgsst:21 a=6tzPpILExf-KoGQT:21 a=CjuIK1q_8ugA:10 This makes all the test code in nptl/ and rt/ compile even if the configuration does not use SIGCANCEL (in NPTL internals) and does not provide SA_SIGINFO or SIGRTMIN (in the API). Thanks, Roland * nptl/tst-cancel4.c (tf_sigpause) [!SIGCANCEL]: Call pause instead of __xpg_sigpause. * nptl/tst-signal3.c: Conditionalize body on [SIGRTMIN]. * nptl/tst-signal6.c: Likewise. * rt/tst-mqueue5.c: Conditionalize body on [SIGRTMIN && SA_SIGINFO]. * rt/tst-timer4.c: Conditionalize body on [SA_SIGINFO]. 2015-03-04 Roland McGrath --- a/nptl/tst-cancel4.c +++ b/nptl/tst-cancel4.c @@ -781,9 +781,13 @@ tf_sigpause (void *arg) pthread_cleanup_push (cl, NULL); +#ifdef SIGCANCEL /* Just for fun block the cancellation signal. We need to use __xpg_sigpause since otherwise we will get the BSD version. */ __xpg_sigpause (SIGCANCEL); +#else + pause (); +#endif pthread_cleanup_pop (0); --- a/nptl/tst-signal3.c +++ b/nptl/tst-signal3.c @@ -25,13 +25,14 @@ #include -/* Number of different signalss to use. Also is the number of - threads. */ -#define N 10 +#ifdef SIGRTMIN + +/* Number of different signals to use. Also is the number of threads. */ +# define N 10 /* Maximum number of threads in flight at any one time. */ -#define INFLIGHT 5 +# define INFLIGHT 5 /* Number of signals sent in total. */ -#define ROUNDS 10000 +# define ROUNDS 10000 static int received[N][N]; @@ -255,6 +256,11 @@ do_test (void) return result; } -#define TIMEOUT 10 -#define TEST_FUNCTION do_test () +# define TIMEOUT 10 +# define TEST_FUNCTION do_test () + +#else +# define TEST_FUNCTION 0 +#endif + #include "../test-skeleton.c" --- a/nptl/tst-signal6.c +++ b/nptl/tst-signal6.c @@ -24,7 +24,9 @@ #include -#define N 2 +#ifdef SIGRTMIN + +# define N 2 static pthread_barrier_t bar; static struct { @@ -187,5 +189,9 @@ do_test (void) return 0; } -#define TEST_FUNCTION do_test () +# define TEST_FUNCTION do_test () + +#else +# define TEST_FUNCTION 0 +#endif #include "../test-skeleton.c" --- a/rt/tst-mqueue5.c +++ b/rt/tst-mqueue5.c @@ -35,7 +35,7 @@ #define TIMEOUT 3 -#if _POSIX_THREADS +#if _POSIX_THREADS && defined SIGRTMIN && defined SA_SIGINFO # include volatile int rtmin_cnt; --- a/rt/tst-timer4.c +++ b/rt/tst-timer4.c @@ -24,7 +24,7 @@ #include #include #include -#if _POSIX_THREADS +#if _POSIX_THREADS && defined SA_SIGINFO # include # ifndef TEST_CLOCK @@ -641,6 +641,11 @@ do_test (void) } return result; } + +#elif defined TEST_CLOCK_MISSING +/* This just ensures that any functions called in TEST_CLOCK_MISSING + are not diagnosed as unused. */ +# define TEST_FUNCTION (TEST_CLOCK_MISSING (TEST_CLOCK), 0) #else # define TEST_FUNCTION 0 #endif