From: Yaakov Selkowitz <yselkowi@redhat.com>
To: newlib@sourceware.org
Subject: [PATCH] Feature test macros overhaul: signal.h (part 3)
Date: Tue, 13 Jun 2017 20:01:00 -0000 [thread overview]
Message-ID: <20170613200022.5056-2-yselkowi@redhat.com> (raw)
In-Reply-To: <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 <yselkowi@redhat.com>
---
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
--
2.12.3
next prev parent reply other threads:[~2017-06-13 20:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-13 20:00 [PATCH] stdio.h: guard function macros with !__cplusplus Yaakov Selkowitz
2017-06-13 20:01 ` Yaakov Selkowitz [this message]
2017-06-15 9:48 ` [PATCH] Feature test macros overhaul: signal.h (part 3) Thomas Preudhomme
2017-06-15 12:52 ` Thomas Preudhomme
2017-06-15 14:20 ` Thomas Preudhomme
2017-06-19 8:29 ` Thomas Preudhomme
2017-06-19 11:02 ` Corinna Vinschen
2017-06-14 8:48 ` [PATCH] stdio.h: guard function macros with !__cplusplus Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170613200022.5056-2-yselkowi@redhat.com \
--to=yselkowi@redhat.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).