Add standards visibility conditionals. Change any uses of sigset_t to

struct __sigset to avoid depending on objects from <sys/signal.h>.
This commit is contained in:
Mike Barcroft 2002-10-13 00:31:46 +00:00
parent 3357acdd16
commit 7a77412855
7 changed files with 69 additions and 30 deletions

View File

@ -31,15 +31,18 @@
#ifndef _ALPHA_SIGNAL_H_
#define _ALPHA_SIGNAL_H_
#include <sys/cdefs.h>
#include <sys/_sigset.h>
typedef long sig_atomic_t;
#ifndef _ANSI_SOURCE
#if __XSI_VISIBLE
/*
* Minimum signal stack size. The current signal frame
* for Alpha is 808 bytes large.
*/
#define MINSIGSTKSZ (1024 * 4)
#endif
/*
* Only the kernel should need these old type definitions.
@ -74,14 +77,15 @@ struct osigcontext {
unsigned long sc_traparg_a2; /* a2 argument to trap at exception */
long sc_xxx2[3]; /* sc_fp_trap_pc, sc_fp_trigger_sum, sc_fp_trigger_inst */
};
#endif
#endif /* _KERNEL */
#if __BSD_VISIBLE
/*
* The sequence of the fields should match those in
* mcontext_t. Keep them in sync!
*/
struct sigcontext {
sigset_t sc_mask; /* signal mask to restore */
struct __sigset sc_mask; /* signal mask to restore */
long sc_onstack; /* sigstack state to restore */
unsigned long sc_regs[32]; /* integer register set (see above) */
long sc_ps; /* ps to restore */
@ -100,5 +104,6 @@ struct sigcontext {
#define sc_sp sc_regs[R_SP]
#endif /* !_ANSI_SOURCE */
#endif /* __BSD_VISIBLE */
#endif /* !_ALPHA_SIGNAL_H_*/

View File

@ -37,20 +37,24 @@
#ifndef _MACHINE_SIGNAL_H_
#define _MACHINE_SIGNAL_H_
#include <sys/cdefs.h>
#include <sys/_sigset.h>
/*
* Machine-dependent signal definitions
*/
typedef int sig_atomic_t;
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
#if __XSI_VISIBLE
/*
* Minimum signal stack size. The current signal frame
* for i386 is 408 bytes large.
*/
#define MINSIGSTKSZ (512 * 4)
#endif
#if __BSD_VISIBLE
#include <machine/trap.h> /* codes for SIGILL, SIGFPE */
/*
@ -96,7 +100,7 @@ struct osigcontext {
* those in mcontext_t.
*/
struct sigcontext {
sigset_t sc_mask; /* signal mask to restore */
struct __sigset sc_mask; /* signal mask to restore */
int sc_onstack; /* sigstack state to restore */
int sc_gs; /* machine state (struct trapframe): */
int sc_fs;
@ -135,6 +139,6 @@ struct sigcontext {
#define sc_ps sc_efl
#define sc_eflags sc_efl
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
#endif /* __BSD_VISIBLE */
#endif /* !_MACHINE_SIGNAL_H_ */

View File

@ -39,12 +39,15 @@
#ifndef _MACHINE_SIGNAL_H_
#define _MACHINE_SIGNAL_H_
#include <sys/cdefs.h>
typedef long sig_atomic_t;
#ifndef _ANSI_SOURCE
#if __XSI_VISIBLE
#define MINSIGSTKSZ (1024 * 4)
#endif
#if __BSD_VISIBLE
typedef int osigset_t;
struct osigcontext {
@ -53,6 +56,6 @@ struct osigcontext {
struct sigcontext {
};
#endif /* !_ANSI_SOURCE */
#endif
#endif /* !_MACHINE_SIGNAL_H_ */

View File

@ -37,20 +37,24 @@
#ifndef _MACHINE_SIGNAL_H_
#define _MACHINE_SIGNAL_H_
#include <sys/cdefs.h>
#include <sys/_sigset.h>
/*
* Machine-dependent signal definitions
*/
typedef int sig_atomic_t;
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
#if __XSI_VISIBLE
/*
* Minimum signal stack size. The current signal frame
* for i386 is 408 bytes large.
*/
#define MINSIGSTKSZ (512 * 4)
#endif
#if __BSD_VISIBLE
#include <machine/trap.h> /* codes for SIGILL, SIGFPE */
/*
@ -96,7 +100,7 @@ struct osigcontext {
* those in mcontext_t.
*/
struct sigcontext {
sigset_t sc_mask; /* signal mask to restore */
struct __sigset sc_mask; /* signal mask to restore */
int sc_onstack; /* sigstack state to restore */
int sc_gs; /* machine state (struct trapframe): */
int sc_fs;
@ -135,6 +139,6 @@ struct sigcontext {
#define sc_ps sc_efl
#define sc_eflags sc_efl
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
#endif /* __BSD_VISIBLE */
#endif /* !_MACHINE_SIGNAL_H_ */

View File

@ -31,10 +31,12 @@
#ifndef _MACHINE_SIGNAL_H_
#define _MACHINE_SIGNAL_H_
#include <sys/cdefs.h>
#include <sys/_sigset.h>
typedef long sig_atomic_t;
#ifndef _ANSI_SOURCE
#if __BSD_VISIBLE
/* portable macros for SIGFPE/ARITHTRAP */
#define FPE_INTOVF 1 /* integer overflow */
#define FPE_INTDIV 2 /* integer divide by zero */
@ -46,12 +48,17 @@ typedef long sig_atomic_t;
#define FPE_FLTSUB 8 /* subscript out of range */
#define BUS_SEGM_FAULT 30 /* segment protection base */
#endif
#if __XSI_VISIBLE
/*
* Minimum signal stack size. The current signal frame
* for IA-64 is 2656 bytes large.
*/
#define MINSIGSTKSZ (3072 * 4)
#endif
#ifdef _KERNEL
#ifndef _IA64_FPREG_DEFINED
@ -78,12 +85,15 @@ struct osigcontext {
int _not_used;
};
#endif /* !_KERNEL */
#if __BSD_VISIBLE
/*
* The sequence of the fields should match those in
* mcontext_t. Keep them in sync!
*/
struct sigcontext {
sigset_t sc_mask; /* signal mask to restore */
struct __sigset sc_mask; /* signal mask to restore */
unsigned long sc_onstack;
unsigned long sc_flags;
unsigned long sc_nat;
@ -103,6 +113,6 @@ struct sigcontext {
unsigned long sc_gr[32];
struct ia64_fpreg sc_fr[128];
};
#endif /* __BSD_VISIBLE */
#endif /* !_ANSI_SOURCE */
#endif /* !_MACHINE_SIGNAL_H_*/

View File

@ -35,16 +35,22 @@
#ifndef _MACHINE_SIGNAL_H_
#define _MACHINE_SIGNAL_H_
#include <sys/cdefs.h>
#if __XSI_VISIBLE
#define MINSIGSTKSZ (512 * 4)
#endif
typedef int sig_atomic_t;
#ifdef _KERNEL
typedef unsigned int osigset_t;
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
!defined(_XOPEN_SOURCE)
#include <machine/frame.h>
/*
* XXX why do we have compatibility structs for a new platform?
*/
#if defined(__LIBC12_SOURCE__) || defined(_KERNEL)
struct sigcontext13 {
int sc_onstack; /* saved onstack flag */
@ -57,15 +63,18 @@ struct osigcontext {
int sc_onstack; /* saved onstack flag */
int __sc_mask13; /* saved signal mask (old style) */
struct trapframe sc_frame; /* saved registers */
sigset_t sc_mask; /* saved signal mask (new style) */
struct __sigset sc_mask; /* saved signal mask (new style) */
};
#endif /* _KERNEL */
#if __BSD_VISIBLE
struct sigcontext {
int sc_onstack; /* saved onstack flag */
int __sc_mask13; /* saved signal mask (old style) */
struct trapframe sc_frame; /* saved registers */
sigset_t sc_mask; /* saved signal mask (new style) */
struct __sigset sc_mask; /* saved signal mask (new style) */
};
#endif
#endif /* !_ANSI_SOURCE && !_POSIX_C_SOURCE && !_XOPEN_SOURCE */
#endif /* !_MACHINE_SIGNAL_H_ */

View File

@ -38,22 +38,26 @@
#ifndef _MACHINE_SIGNAL_H_
#define _MACHINE_SIGNAL_H_
#include <sys/cdefs.h>
typedef long sig_atomic_t;
#ifndef _ANSI_SOURCE
#if __XSI_VISIBLE
#define MINSIGSTKSZ (1024 * 4)
#endif
#if _KERNEL
typedef int osigset_t;
struct osigcontext {
int dummy;
};
#endif
#if __BSD_VISIBLE
struct sigcontext {
int dummy;
int _dummy;
};
#endif /* !_ANSI_SOURCE */
#endif /* __BSD_VISIBLE */
#endif /* !_MACHINE_SIGNAL_H_ */