2011-02-12 05:22:29 +00:00
|
|
|
#ifndef _SIGNAL_H
|
|
|
|
#define _SIGNAL_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-02-15 01:33:54 +00:00
|
|
|
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
|
|
|
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
|
|
|
|
2011-02-20 06:48:51 +00:00
|
|
|
#ifdef _GNU_SOURCE
|
|
|
|
#define __siginfo siginfo
|
|
|
|
#endif
|
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
#define __NEED_size_t
|
|
|
|
#define __NEED_pid_t
|
|
|
|
#define __NEED_uid_t
|
|
|
|
#define __NEED_struct_timespec
|
|
|
|
#define __NEED_pthread_t
|
2011-03-29 17:01:25 +00:00
|
|
|
#define __NEED_pthread_attr_t
|
2011-02-12 05:22:29 +00:00
|
|
|
#define __NEED_time_t
|
|
|
|
#define __NEED_clock_t
|
|
|
|
#define __NEED_sigset_t
|
|
|
|
#define __NEED_siginfo_t
|
|
|
|
|
|
|
|
#include <bits/alltypes.h>
|
|
|
|
|
2011-03-29 17:01:25 +00:00
|
|
|
struct sigaction {
|
2011-02-12 05:22:29 +00:00
|
|
|
union {
|
|
|
|
void (*sa_handler)(int);
|
|
|
|
void (*sa_sigaction)(int, siginfo_t *, void *);
|
|
|
|
} __sa_handler;
|
|
|
|
sigset_t sa_mask;
|
|
|
|
int sa_flags;
|
|
|
|
void (*__sa_restorer)(void);
|
|
|
|
};
|
|
|
|
#define sa_handler __sa_handler.sa_handler
|
|
|
|
#define sa_sigaction __sa_handler.sa_sigaction
|
|
|
|
|
2011-03-29 17:01:25 +00:00
|
|
|
typedef struct {
|
2011-02-12 05:22:29 +00:00
|
|
|
void *ss_sp;
|
|
|
|
int ss_flags;
|
|
|
|
size_t ss_size;
|
|
|
|
} stack_t;
|
|
|
|
|
2011-03-29 17:01:25 +00:00
|
|
|
union sigval {
|
2011-02-12 05:22:29 +00:00
|
|
|
int sival_int;
|
|
|
|
void *sival_ptr;
|
|
|
|
};
|
|
|
|
|
2011-03-29 17:01:25 +00:00
|
|
|
struct sigevent {
|
|
|
|
union sigval sigev_value;
|
|
|
|
int sigev_signo;
|
|
|
|
int sigev_notify;
|
|
|
|
void (*sigev_notify_function)(union sigval);
|
|
|
|
pthread_attr_t *sigev_notify_attributes;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SIGEV_SIGNAL 0
|
|
|
|
#define SIGEV_NONE 1
|
|
|
|
#define SIGEV_THREAD 2
|
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
int __libc_current_sigrtmin(void);
|
|
|
|
int __libc_current_sigrtmax(void);
|
|
|
|
|
|
|
|
#define SIGRTMIN (__libc_current_sigrtmin())
|
|
|
|
#define SIGRTMAX (__libc_current_sigrtmax())
|
|
|
|
|
|
|
|
int kill(pid_t, int);
|
|
|
|
|
|
|
|
int sigemptyset(sigset_t *);
|
|
|
|
int sigfillset(sigset_t *);
|
|
|
|
int sigaddset(sigset_t *, int);
|
|
|
|
int sigdelset(sigset_t *, int);
|
|
|
|
int sigismember(const sigset_t *, int);
|
|
|
|
|
|
|
|
int sigprocmask(int, const sigset_t *, sigset_t *);
|
|
|
|
int sigsuspend(const sigset_t *);
|
|
|
|
int sigaction(int, const struct sigaction *, struct sigaction *);
|
|
|
|
int sigpending(sigset_t *);
|
|
|
|
int sigwait(const sigset_t *, int *);
|
|
|
|
int sigwaitinfo(const sigset_t *, siginfo_t *);
|
|
|
|
int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *);
|
|
|
|
int sigqueue(pid_t, int, const union sigval);
|
|
|
|
|
2011-02-15 01:33:54 +00:00
|
|
|
int pthread_sigmask(int, const sigset_t *, sigset_t *);
|
|
|
|
int pthread_kill(pthread_t, int);
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2011-02-15 01:33:54 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2011-02-15 01:33:54 +00:00
|
|
|
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
|
|
|
int killpg(pid_t, int);
|
|
|
|
int sigaltstack(const stack_t *, stack_t *);
|
2011-02-12 05:22:29 +00:00
|
|
|
int sighold(int);
|
|
|
|
int sigignore(int);
|
2011-02-15 01:33:54 +00:00
|
|
|
int siginterrupt(int, int);
|
|
|
|
int sigpause(int);
|
|
|
|
int sigrelse(int);
|
2011-02-12 05:22:29 +00:00
|
|
|
void (*sigset(int, void (*)(int)))(int);
|
2011-02-15 01:33:54 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
#ifdef _GNU_SOURCE
|
|
|
|
typedef int (*sighandler_t)(int);
|
2011-02-15 01:33:54 +00:00
|
|
|
void (*bsd_signal(int, void (*)(int)))(int);
|
2011-02-12 05:22:29 +00:00
|
|
|
#endif
|
|
|
|
|
2011-02-15 20:10:00 +00:00
|
|
|
#include <bits/signal.h>
|
|
|
|
|
2011-02-15 01:33:54 +00:00
|
|
|
typedef int sig_atomic_t;
|
|
|
|
|
|
|
|
void (*signal(int, void (*)(int)))(int);
|
|
|
|
int raise(int);
|
|
|
|
|
2011-02-12 05:22:29 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|