Added siginfo_t structure as required by ISO-C 99 - it's not yet used, though.

Smaller style cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8344 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-07-07 12:48:27 +00:00
parent 288ff1988f
commit c3d35103c7
1 changed files with 22 additions and 18 deletions

View File

@ -1,20 +1,33 @@
#ifndef _SIGNAL_H_
#define _SIGNAL_H_
/*
** Distributed under the terms of the OpenBeOS License.
*/
#include <sys/types.h>
typedef int sig_atomic_t;
typedef int sig_atomic_t;
typedef long sigset_t;
typedef void (*sig_func_t)(int);
typedef void (*__signal_func_ptr)(int); /* deprecated, for compatibility with BeOS only */
// ToDo: actually make use of this structure!
typedef struct {
int si_signo; /* signal number */
int si_code; /* signal code */
int si_errno; /* if non zero, an error number associated with this signal */
pid_t si_pid; /* sending process ID */
uid_t si_uid; /* real user ID of sending process */
void *si_addr; /* address of faulting instruction */
int si_status; /* exit value or signal */
long si_band; /* band event for SIGPOLL */
} siginfo_t;
/*
* macros defining the standard signal handling behavior
*/
@ -31,10 +44,10 @@ typedef void (*__signal_func_ptr)(int); /* deprecated, for compatibility with B
*
*/
struct sigaction {
sig_func_t sa_handler;
sigset_t sa_mask;
int sa_flags;
void *sa_userdata; /* will be passed to the signal handler */
sig_func_t sa_handler;
sigset_t sa_mask;
int sa_flags;
void *sa_userdata; /* will be passed to the signal handler */
};
@ -49,14 +62,13 @@ struct sigaction {
#define SA_STACK 0x10
/*
* for signals using an alternate stack
*/
typedef struct stack_t {
void *ss_sp;
size_t ss_size;
int ss_flags;
void *ss_sp;
size_t ss_size;
int ss_flags;
} stack_t;
@ -68,7 +80,6 @@ typedef struct stack_t {
#define SIG_SETMASK 3
/*
* The list of all defined signals:
*
@ -112,12 +123,10 @@ typedef struct stack_t {
#define NSIG (__signal_max+1) /* the number of defined signals */
/* the global table of text strings containing descriptions for each signal */
extern const char * const sys_siglist[NSIG];
#ifdef __cplusplus
extern "C" {
#endif
@ -168,7 +177,6 @@ sigdelset(sigset_t *set, int sig)
}
#endif
/*
* ==================================================
* !!! SPECIAL NOTES CONCERNING NON-POSIX EXTENSIONS:
@ -234,9 +242,6 @@ sigdelset(sigset_t *set, int sig)
* open some interesting programming possibilities.
*/
/*
* the vregs struct:
*
@ -400,5 +405,4 @@ struct vregs {
#endif /* __INTEL__ */
#endif /* _SIGNAL_H_ */