aboutsummaryrefslogtreecommitdiffstats
path: root/include/signal.h
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1995-06-28 02:14:13 +0000
committerBruce Evans <bde@FreeBSD.org>1995-06-28 02:14:13 +0000
commit943c18018b7178d7b6b7adb3707cea858511922b (patch)
treea88d5304db67310228e4f31867772eab4ff6ad9a /include/signal.h
parent200db8340229d28412489bbf523df1d2ac0da85e (diff)
downloadsrc-943c18018b7178d7b6b7adb3707cea858511922b.tar.gz
src-943c18018b7178d7b6b7adb3707cea858511922b.zip
Fix standards conformance bugs in <signal.h>:
include/signal.h: There was massive namespace pollution from including <sys/types.h>. POSIX functions were declared even when _ANSI_SOURCE is defined. sys.sys/signal.h: NSIG was declared even if _ANSI_SOURCE or _POSIX_SOURCE is defined. sig_atomic_t wasn't declared if _POSIX_SOURCE is defined. Declare a typedef for signal handling functions and use it to unobfuscate declarations and to avoid half-baked function types that cause unwanted compiler warnings at certain warning levels. Fix confusing comment about SA_RESTART. sys/i386/include/signal.h: This has to be included to get the declaration of sig_atomic_t even when _ANSI_SOURCE is defined, so be more careful about polluting the ANSI namespace. Uniformize idempotency ifdefs.
Notes
Notes: svn path=/head/; revision=9343
Diffstat (limited to 'include/signal.h')
-rw-r--r--include/signal.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/signal.h b/include/signal.h
index 6bb7ddf2cca4..d8ebeeeeac08 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -33,12 +33,12 @@
* @(#)signal.h 8.3 (Berkeley) 3/30/94
*/
-#ifndef _USER_SIGNAL_H
-#define _USER_SIGNAL_H
+#ifndef _SIGNAL_H_
+#define _SIGNAL_H_
-#include <sys/types.h>
#include <sys/cdefs.h>
#include <sys/signal.h>
+#include <machine/ansi.h>
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
extern __const char *__const sys_signame[NSIG];
@@ -48,7 +48,7 @@ extern __const char *__const sys_siglist[NSIG];
__BEGIN_DECLS
int raise __P((int));
#ifndef _ANSI_SOURCE
-int kill __P((pid_t, int));
+int kill __P((_BSD_PID_T_, int));
int sigaction __P((int, const struct sigaction *, struct sigaction *));
int sigaddset __P((sigset_t *, int));
int sigdelset __P((sigset_t *, int));
@@ -59,7 +59,7 @@ int sigpending __P((sigset_t *));
int sigprocmask __P((int, const sigset_t *, sigset_t *));
int sigsuspend __P((const sigset_t *));
#ifndef _POSIX_SOURCE
-int killpg __P((pid_t, int));
+int killpg __P((_BSD_PID_T_, int));
int sigblock __P((int));
int siginterrupt __P((int, int));
int sigpause __P((int));
@@ -68,15 +68,17 @@ int sigsetmask __P((int));
int sigstack __P((const struct sigstack *, struct sigstack *));
int sigvec __P((int, struct sigvec *, struct sigvec *));
void psignal __P((unsigned int, const char *));
-#endif /* !_POSIX_SOURCE */
-#endif /* !_ANSI_SOURCE */
+#endif /* !_POSIX_SOURCE */
+#endif /* !_ANSI_SOURCE */
__END_DECLS
+#ifndef _ANSI_SOURCE
/* List definitions after function declarations, or Reiser cpp gets upset. */
#define sigaddset(set, signo) (*(set) |= 1 << ((signo) - 1), 0)
#define sigdelset(set, signo) (*(set) &= ~(1 << ((signo) - 1)), 0)
#define sigemptyset(set) (*(set) = 0, 0)
#define sigfillset(set) (*(set) = ~(sigset_t)0, 0)
#define sigismember(set, signo) ((*(set) & (1 << ((signo) - 1))) != 0)
+#endif /* !_ANSI_SOURCE */
-#endif /* !_USER_SIGNAL_H */
+#endif /* !_SIGNAL_H_ */