From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89053 invoked by alias); 15 Jun 2017 09:48:43 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 88576 invoked by uid 89); 15 Jun 2017 09:48:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Jun 2017 09:48:22 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BEBA7344 for ; Thu, 15 Jun 2017 02:48:13 -0700 (PDT) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B71D3F581 for ; Thu, 15 Jun 2017 02:48:13 -0700 (PDT) Subject: Re: [PATCH] Feature test macros overhaul: signal.h (part 3) To: newlib@sourceware.org References: <20170613200022.5056-1-yselkowi@redhat.com> <20170613200022.5056-2-yselkowi@redhat.com> From: Thomas Preudhomme Message-ID: <7c917d1c-2486-93f4-b9c8-c49820350447@foss.arm.com> Date: Thu, 15 Jun 2017 09:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170613200022.5056-2-yselkowi@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00430.txt.bz2 Hi, This patch makes lots of function using pthread_t type visible when __POSIX_THREADS is not defined as long as __POSIX_VISIBLE is. However, the guard in sys/_pthreadtypes.h is still checking against __POSIX_THREADS. This leads to build failure on arm-none-eabi targets. Best regards, Thomas On 13/06/17 21:00, Yaakov Selkowitz wrote: > Notably, sigaction and friends are POSIX, but the form of sigpause > currently provided is BSD. > > Signed-off-by: Yaakov Selkowitz > --- > newlib/libc/include/sys/signal.h | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > > diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h > index 8d1b53fce..a56f18a1b 100644 > --- a/newlib/libc/include/sys/signal.h > +++ b/newlib/libc/include/sys/signal.h > @@ -152,13 +152,15 @@ typedef struct sigaltstack { > size_t ss_size; /* Stack size. */ > } stack_t; > > +#if __POSIX_VISIBLE > #define SIG_SETMASK 0 /* set mask with sigprocmask() */ > #define SIG_BLOCK 1 /* set of signals to block */ > #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ > > int _EXFUN(sigprocmask, (int how, const sigset_t *set, sigset_t *oset)); > +#endif > > -#if defined(_POSIX_THREADS) > +#if __POSIX_VISIBLE >= 199506 > int _EXFUN(pthread_sigmask, (int how, const sigset_t *set, sigset_t *oset)); > #endif > > @@ -168,10 +170,14 @@ int _EXFUN(_kill, (pid_t, int)); > #endif /* _COMPILING_NEWLIB */ > #endif /* __CYGWIN__ || __rtems__ */ > > +#if __POSIX_VISIBLE > int _EXFUN(kill, (pid_t, int)); > +#endif > > #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 > int _EXFUN(killpg, (pid_t, int)); > +#endif > +#if __POSIX_VISIBLE > int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *)); > int _EXFUN(sigaddset, (sigset_t *, const int)); > int _EXFUN(sigdelset, (sigset_t *, const int)); > @@ -180,7 +186,7 @@ int _EXFUN(sigfillset, (sigset_t *)); > int _EXFUN(sigemptyset, (sigset_t *)); > int _EXFUN(sigpending, (sigset_t *)); > int _EXFUN(sigsuspend, (const sigset_t *)); > -int _EXFUN(sigpause, (int)); > +int _EXFUN(sigwait, (const sigset_t *set, int *sig)); > > #if !defined(__CYGWIN__) && !defined(__rtems__) > /* These depend upon the type of sigset_t, which right now > @@ -192,17 +198,21 @@ int _EXFUN(sigpause, (int)); > #define sigfillset(what) (*(what) = ~(0), 0) > #define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) > #endif /* !__CYGWIN__ && !__rtems__ */ > -#endif /* __BSD_VISIBLE || __XSI_VISIBLE >= 4 */ > +#endif /* __POSIX_VISIBLE */ > + > +#if __BSD_VISIBLE > +int _EXFUN(sigpause, (int)); > +#endif > > #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809 > int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict)); > #endif > > -#if defined(_POSIX_THREADS) > +#if __POSIX_VISIBLE >= 199506 > int _EXFUN(pthread_kill, (pthread_t thread, int sig)); > #endif > > -#if defined(_POSIX_REALTIME_SIGNALS) > +#if __POSIX_VISIBLE >= 199309 > > /* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 > NOTE: P1003.1c/D10, p. 39 adds sigwait(). */ > @@ -211,12 +221,10 @@ int _EXFUN(sigwaitinfo, (const sigset_t *set, siginfo_t *info)); > int _EXFUN(sigtimedwait, > (const sigset_t *set, siginfo_t *info, const struct timespec *timeout) > ); > -int _EXFUN(sigwait, (const sigset_t *set, int *sig)); > - > /* 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 */ > int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value)); > > -#endif /* defined(_POSIX_REALTIME_SIGNALS) */ > +#endif /* __POSIX_VISIBLE >= 199309 */ > > #if defined(___AM29K__) > /* These all need to be defined for ANSI C, but I don't think they are >