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:
+22
-18
@@ -1,20 +1,33 @@
|
|||||||
#ifndef _SIGNAL_H_
|
#ifndef _SIGNAL_H_
|
||||||
#define _SIGNAL_H_
|
#define _SIGNAL_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
** Distributed under the terms of the OpenBeOS License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
||||||
typedef int sig_atomic_t;
|
typedef int sig_atomic_t;
|
||||||
typedef long sigset_t;
|
typedef long sigset_t;
|
||||||
|
|
||||||
typedef void (*sig_func_t)(int);
|
typedef void (*sig_func_t)(int);
|
||||||
typedef void (*__signal_func_ptr)(int); /* deprecated, for compatibility with BeOS only */
|
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
|
* macros defining the standard signal handling behavior
|
||||||
*/
|
*/
|
||||||
@@ -31,10 +44,10 @@ typedef void (*__signal_func_ptr)(int); /* deprecated, for compatibility with B
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct sigaction {
|
struct sigaction {
|
||||||
sig_func_t sa_handler;
|
sig_func_t sa_handler;
|
||||||
sigset_t sa_mask;
|
sigset_t sa_mask;
|
||||||
int sa_flags;
|
int sa_flags;
|
||||||
void *sa_userdata; /* will be passed to the signal handler */
|
void *sa_userdata; /* will be passed to the signal handler */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -49,14 +62,13 @@ struct sigaction {
|
|||||||
#define SA_STACK 0x10
|
#define SA_STACK 0x10
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for signals using an alternate stack
|
* for signals using an alternate stack
|
||||||
*/
|
*/
|
||||||
typedef struct stack_t {
|
typedef struct stack_t {
|
||||||
void *ss_sp;
|
void *ss_sp;
|
||||||
size_t ss_size;
|
size_t ss_size;
|
||||||
int ss_flags;
|
int ss_flags;
|
||||||
} stack_t;
|
} stack_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -68,7 +80,6 @@ typedef struct stack_t {
|
|||||||
#define SIG_SETMASK 3
|
#define SIG_SETMASK 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The list of all defined signals:
|
* The list of all defined signals:
|
||||||
*
|
*
|
||||||
@@ -112,12 +123,10 @@ typedef struct stack_t {
|
|||||||
#define NSIG (__signal_max+1) /* the number of defined signals */
|
#define NSIG (__signal_max+1) /* the number of defined signals */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* the global table of text strings containing descriptions for each signal */
|
/* the global table of text strings containing descriptions for each signal */
|
||||||
extern const char * const sys_siglist[NSIG];
|
extern const char * const sys_siglist[NSIG];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -168,7 +177,6 @@ sigdelset(sigset_t *set, int sig)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ==================================================
|
* ==================================================
|
||||||
* !!! SPECIAL NOTES CONCERNING NON-POSIX EXTENSIONS:
|
* !!! SPECIAL NOTES CONCERNING NON-POSIX EXTENSIONS:
|
||||||
@@ -234,9 +242,6 @@ sigdelset(sigset_t *set, int sig)
|
|||||||
* open some interesting programming possibilities.
|
* open some interesting programming possibilities.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the vregs struct:
|
* the vregs struct:
|
||||||
*
|
*
|
||||||
@@ -400,5 +405,4 @@ struct vregs {
|
|||||||
|
|
||||||
#endif /* __INTEL__ */
|
#endif /* __INTEL__ */
|
||||||
|
|
||||||
|
|
||||||
#endif /* _SIGNAL_H_ */
|
#endif /* _SIGNAL_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user