From patchwork Tue Jun 13 20:00:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 105414 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp579228qgd; Tue, 13 Jun 2017 13:01:29 -0700 (PDT) X-Received: by 10.99.115.82 with SMTP id d18mr1152637pgn.155.1497384089145; Tue, 13 Jun 2017 13:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497384089; cv=none; d=google.com; s=arc-20160816; b=H3iINr0wExXyWO+VEKOFWHxcZtRVJ5bzS3EPa6zOwP+7It/JfD3ZnuoNwkuvDkpzoe n/A6EtUR6a2TZlvhNYdGfC3O4uIeXBV6IJeBdArLQBNz3dDP2Zvic5Is1Je7mRxX2cDF qq330MlpUqHNaBxXfpD/t+MsN27f1EmoVb3NH8mYr+ZMcEsaH46aImmNub+lLHJ2D4yP WrTqoYfU1nwlGfePBYo98SQ+XB6Hkwnrg0b6HfKB1HyP+/MAXIbPWtZ4YjWjqj/c82r1 Xrv/6pXgFpHveL2Jq/pu+RKX3cIWDbf50K2HpEMkU+vpNSf72V/QWyJARZGFgou+JONG vcig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:dkim-filter :dmarc-filter: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=hb6BpBzPKn+9TyUMZVgD8aRgX6hsDQZYnykRKdsvhmE=; b=WYY+8kxJAQNpo67IsrFeO8BM4N9oIBi/KojdKdw8r15Y7dE9+9XpDRjMswfT1RZJgC U4EHWoS50U1IxX7dZlTRmrQErbwpDljZ8ufIXVZv+zqG458uRCnmVoz+pytOlugaM1kS d6IVhiBeC7TtGb468B0BJC3ADsI6ilrr94qNmZO9+TEUNuJq9zHZ1muHwPLIxZvLY2Zh pEdU3GiQ7F8t3uwGFM/ms+m/rWIAM2JXgRQV5ARVqZlL7LS1WGJJcMzmfWhwGTBET8+4 Rq03vdjtG9kWxko+OOn3o8JW5R3qEREVcPPgfuBuF+1t8aWN5iAlDFN3qar5B9ikc9fU qE6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of newlib-return-14649-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-14649-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g1si654510plb.271.2017.06.13.13.01.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 13:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-14649-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; spf=pass (google.com: domain of newlib-return-14649-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-14649-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=R53GSlHztaCTxkYD4hUVCe68rVo/oSZ Rkh05IhhBp9Ys1nw2oquGmwGsekndn0p4f93NtzBdJQF3nIy04f2s9jmsXg/QtYY Ic7ANLbZmufBSWvte6k/a7VuztTl9JxK+szvKGdsGblAn46GtZcDMHj1UTMqZZpS W9QhsOlTgtQ4= 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:subject:date:message-id:in-reply-to :references; s=default; bh=iiIjxoPPGWKNYbeLyunrZwOvcFM=; b=n5CAf whq6ITtSrJ+kRSdXr7YotxvQnueOE2y8mwOP0ssMnrRPM06jLYZZhskKmtaW0f0N vRb75SHTyMUsER0NY56/dte+jMhqWQQ4maSXv9bndS6uF3JfNSHaRsj0h5CHbfLD shcKuH4O4tKkD0NQx/uwYKOiGbaNkVQRWTUjbM= Received: (qmail 65321 invoked by alias); 13 Jun 2017 20:01:00 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 58922 invoked by uid 89); 13 Jun 2017 20:00:50 -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, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Jun 2017 20:00:49 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E434123E6E5 for ; Tue, 13 Jun 2017 20:00:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E434123E6E5 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=yselkowi@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E434123E6E5 Received: from localhost.localdomain (ovpn-120-23.rdu2.redhat.com [10.10.120.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE36851DE2 for ; Tue, 13 Jun 2017 20:00:50 +0000 (UTC) From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH] Feature test macros overhaul: signal.h (part 3) Date: Tue, 13 Jun 2017 15:00:22 -0500 Message-Id: <20170613200022.5056-2-yselkowi@redhat.com> In-Reply-To: <20170613200022.5056-1-yselkowi@redhat.com> References: <20170613200022.5056-1-yselkowi@redhat.com> 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(-) -- 2.12.3 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