Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2016-03-15 00:39:56 +0300
committerYaakov Selkowitz <yselkowi@redhat.com>2016-03-18 05:09:03 +0300
commit5c78499ae2ae6ac28854b43a1ad73d917b40c62d (patch)
tree57ad3b0c058afc2587ed8a42ec7f0c030c97ded4 /newlib
parent25507f80a21c476f4bfa3cba030e3a0502a491db (diff)
Feature test macros overhaul: signal.h
Use proper internal macros for BSD sig_t and GNU sighandler_t. sigaltstack and friends are XSI even in SUSv4 but in glibc are nonetheless handled as POSIX.1-2008 (not 2001). The requirement for the ucontext_t typedef in signal.h was XSI prior to POSIX.1-2008. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libc/include/signal.h7
-rw-r--r--newlib/libc/include/sys/signal.h19
2 files changed, 11 insertions, 15 deletions
diff --git a/newlib/libc/include/signal.h b/newlib/libc/include/signal.h
index 8c50a2eb3..0324ae71a 100644
--- a/newlib/libc/include/signal.h
+++ b/newlib/libc/include/signal.h
@@ -2,15 +2,18 @@
#define _SIGNAL_H_
#include "_ansi.h"
+#include <sys/cdefs.h>
#include <sys/signal.h>
_BEGIN_STD_C
typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
typedef _sig_func_ptr sig_t; /* BSD naming */
+#endif
+#if __GNU_VISIBLE
typedef _sig_func_ptr sighandler_t; /* glibc naming */
-#endif /* !_POSIX_SOURCE */
+#endif
#define SIG_DFL ((_sig_func_ptr)0) /* Default action */
#define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */
diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h
index 3ff0eb73c..d12d42ffb 100644
--- a/newlib/libc/include/sys/signal.h
+++ b/newlib/libc/include/sys/signal.h
@@ -13,8 +13,6 @@ extern "C" {
#include <sys/_sigset.h>
#include <sys/_timespec.h>
-/* #ifndef __STRICT_ANSI__*/
-
#if !defined(_SIGSET_T_DECLARED)
#define _SIGSET_T_DECLARED
typedef __sigset_t sigset_t;
@@ -77,7 +75,7 @@ typedef struct {
#define SA_NOCLDSTOP 0x1 /* Do not generate SIGCHLD when children stop */
#define SA_SIGINFO 0x2 /* Invoke the signal catching function with */
/* three arguments instead of one. */
-#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
+#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
#define SA_ONSTACK 0x4 /* Signal delivery will be on a separate stack. */
#endif
@@ -125,7 +123,7 @@ struct sigaction
};
#endif /* defined(__rtems__) */
-#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
+#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
/*
* Minimum and default signal stack constants. Allow for target overrides
* from <sys/features.h>.
@@ -187,7 +185,7 @@ int _EXFUN(_kill, (pid_t, int));
int _EXFUN(kill, (pid_t, int));
-#if defined(__CYGWIN__) || defined(__rtems__)
+#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
int _EXFUN(killpg, (pid_t, int));
int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *));
int _EXFUN(sigaddset, (sigset_t *, const int));
@@ -198,12 +196,11 @@ int _EXFUN(sigemptyset, (sigset_t *));
int _EXFUN(sigpending, (sigset_t *));
int _EXFUN(sigsuspend, (const sigset_t *));
int _EXFUN(sigpause, (int));
+#endif
-#if defined(__CYGWIN__) || defined(__rtems__)
-#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
+#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict));
#endif
-#endif
#if defined(_POSIX_THREADS)
#ifdef __CYGWIN__
@@ -230,10 +227,6 @@ int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value));
#endif /* defined(_POSIX_REALTIME_SIGNALS) */
-#endif /* defined(__CYGWIN__) || defined(__rtems__) */
-
-/* #endif __STRICT_ANSI__ */
-
#if defined(___AM29K__)
/* These all need to be defined for ANSI C, but I don't think they are
meaningful. */
@@ -354,7 +347,7 @@ int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value));
#endif
#if defined(__CYGWIN__)
-#if __POSIX_VISIBLE >= 200809
+#if __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
#include <sys/ucontext.h>
#endif
#endif