removed struct _pthread* forward declarations, they're not needed
added some more posix definitions, though they might be never used in Haiku git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17184 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+2
-13
@@ -6,19 +6,6 @@
|
|||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
struct _pthread;
|
|
||||||
struct _pthread_attr;
|
|
||||||
struct _pthread_cond;
|
|
||||||
struct _pthread_cond_attr;
|
|
||||||
struct _pthread_mutex;
|
|
||||||
struct _pthread_mutexattr;
|
|
||||||
struct _pthread_once;
|
|
||||||
struct _pthread_rwlock;
|
|
||||||
struct _pthread_rwlockattr;
|
|
||||||
struct _pthread_barrier;
|
|
||||||
struct _pthread_barrier_attr;
|
|
||||||
struct _pthread_spinlock;
|
|
||||||
|
|
||||||
typedef struct _pthread *pthread_t;
|
typedef struct _pthread *pthread_t;
|
||||||
typedef struct _pthread_attr *pthread_attr_t;
|
typedef struct _pthread_attr *pthread_attr_t;
|
||||||
typedef struct _pthread_mutex *pthread_mutex_t;
|
typedef struct _pthread_mutex *pthread_mutex_t;
|
||||||
@@ -137,6 +124,8 @@ extern void pthread_exit(void *value_ptr);
|
|||||||
extern int pthread_join(pthread_t thread, void **value_ptr);
|
extern int pthread_join(pthread_t thread, void **value_ptr);
|
||||||
extern pthread_t pthread_self(void);
|
extern pthread_t pthread_self(void);
|
||||||
|
|
||||||
|
extern int pthread_kill(pthread_t thread, int sig);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+31
-1
@@ -15,6 +15,12 @@ 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 */
|
||||||
|
|
||||||
|
|
||||||
|
typedef union sigval {
|
||||||
|
int sival_int;
|
||||||
|
void *sival_ptr;
|
||||||
|
} sigval_t;
|
||||||
|
|
||||||
|
|
||||||
// ToDo: actually make use of this structure!
|
// ToDo: actually make use of this structure!
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int si_signo; /* signal number */
|
int si_signo; /* signal number */
|
||||||
@@ -25,6 +31,7 @@ typedef struct {
|
|||||||
void *si_addr; /* address of faulting instruction */
|
void *si_addr; /* address of faulting instruction */
|
||||||
int si_status; /* exit value or signal */
|
int si_status; /* exit value or signal */
|
||||||
long si_band; /* band event for SIGPOLL */
|
long si_band; /* band event for SIGPOLL */
|
||||||
|
union sigval si_value; /* signal value */
|
||||||
} siginfo_t;
|
} siginfo_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +40,8 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
#define SIG_DFL ((sig_func_t) 0) /* the signal was treated in the "default" manner */
|
#define SIG_DFL ((sig_func_t) 0) /* the signal was treated in the "default" manner */
|
||||||
#define SIG_IGN ((sig_func_t) 1) /* the signal was ignored */
|
#define SIG_IGN ((sig_func_t) 1) /* the signal was ignored */
|
||||||
#define SIG_ERR ((sig_func_t)-1) /* an error ocurred during signal processing */
|
#define SIG_ERR ((sig_func_t)-1) /* an error occurred during signal processing */
|
||||||
|
#define SIG_HOLD ((sig_func_t) 3) /* the signal was hold */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -60,7 +68,19 @@ struct sigaction {
|
|||||||
#define SA_NODEFER SA_NOMASK
|
#define SA_NODEFER SA_NOMASK
|
||||||
#define SA_RESTART 0x08
|
#define SA_RESTART 0x08
|
||||||
#define SA_STACK 0x10
|
#define SA_STACK 0x10
|
||||||
|
#define SA_ONSTACK SA_STACK
|
||||||
|
#define SA_RESETHAND 0x20
|
||||||
|
#define SA_SIGINFO 0x40
|
||||||
|
#define SA_NOCLDWAIT 0x80
|
||||||
|
|
||||||
|
/*
|
||||||
|
* values for ss_flags
|
||||||
|
*/
|
||||||
|
#define SS_ONSTACK 0x1
|
||||||
|
#define SS_DISABLE 0x2
|
||||||
|
|
||||||
|
#define MINSIGSTKSZ 4096
|
||||||
|
#define SIGSTKSZ 16384
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for signals using an alternate stack
|
* for signals using an alternate stack
|
||||||
@@ -71,6 +91,10 @@ typedef struct stack_t {
|
|||||||
int ss_flags;
|
int ss_flags;
|
||||||
} stack_t;
|
} stack_t;
|
||||||
|
|
||||||
|
typedef struct sigstack {
|
||||||
|
int ss_onstack;
|
||||||
|
void *ss_sp;
|
||||||
|
} sigstack;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for the 'how' arg of sigprocmask()
|
* for the 'how' arg of sigprocmask()
|
||||||
@@ -147,6 +171,7 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oac
|
|||||||
int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
|
int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
|
||||||
int sigpending(sigset_t *set);
|
int sigpending(sigset_t *set);
|
||||||
int sigsuspend(const sigset_t *mask);
|
int sigsuspend(const sigset_t *mask);
|
||||||
|
int sigwait(const sigset_t *set, int *sig);
|
||||||
|
|
||||||
int sigemptyset(sigset_t *set);
|
int sigemptyset(sigset_t *set);
|
||||||
int sigfillset(sigset_t *set);
|
int sigfillset(sigset_t *set);
|
||||||
@@ -159,6 +184,11 @@ const char *strsignal(int sig);
|
|||||||
void set_signal_stack(void *ptr, size_t size);
|
void set_signal_stack(void *ptr, size_t size);
|
||||||
int sigaltstack(const stack_t *ss, stack_t *oss); /* XXXdbg */
|
int sigaltstack(const stack_t *ss, stack_t *oss); /* XXXdbg */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pthread extension : equivalent of sigprocmask()
|
||||||
|
*/
|
||||||
|
extern int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
|
||||||
|
|
||||||
extern inline int
|
extern inline int
|
||||||
sigismember(const sigset_t *set, int sig)
|
sigismember(const sigset_t *set, int sig)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user