1#ifndef __VSF_LINUX_SIGNAL_H__
2#define __VSF_LINUX_SIGNAL_H__
6#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
16#if VSF_LINUX_CFG_WRAPPER == ENABLED
17#define kill VSF_LINUX_WRAPPER(kill)
18#define signal VSF_LINUX_WRAPPER(signal)
19#define sigaction VSF_LINUX_WRAPPER(sigaction)
20#define sigprocmask VSF_LINUX_WRAPPER(sigprocmask)
21#define raise VSF_LINUX_WRAPPER(raise)
23#define sigemptyset VSF_LINUX_WRAPPER(sigemptyset)
24#define sigfillset VSF_LINUX_WRAPPER(sigfillset)
25#define sigaddsetmask VSF_LINUX_WRAPPER(sigaddsetmask)
26#define sigdelsetmask VSF_LINUX_WRAPPER(sigdelsetmask)
27#define sigtestsetmask VSF_LINUX_WRAPPER(sigtestsetmask)
28#define pthread_sigmask VSF_LINUX_WRAPPER(pthread_sigmask)
29#define sigwaitinfo VSF_LINUX_WRAPPER(sigwaitinfo)
30#define sigtimedwait VSF_LINUX_WRAPPER(sigtimedwait)
33#if VSF_LINUX_CFG_SUPPORT_SIG == ENABLED
35#define sigjmp_buf jmp_buf
36#define siglongjmp(__j, __s)longjmp((__j), (__s))
37#define sigsetjmp(__j, __s) setjmp(__j)
50#define SIGEV_SIGNAL SIGEV_SIGNAL
52#define SIGEV_NONE SIGEV_NONE
54#define SIGEV_THREAD SIGEV_THREAD
120#define SIG_DFL (sighandler_t)0
121#define SIG_IGN (sighandler_t)1
122#define SIG_ERR (sighandler_t)-1
125#define SA_NOCLDSTOP 1
126#define SA_NOCLDWAIT 2
128#define SA_RESTART 0x10000000
129#define SA_NODEFER 0x40000000
133 unsigned long long sig[
_NSIG / (
sizeof(
unsigned long long) << 3)];
135 unsigned long sig[
_NSIG / (
sizeof(
unsigned long) << 3)];
146 void (*sa_restorer)(void);
161static inline int sigaddset(
sigset_t *set,
int signo)
163 set->
sig[0] |= 1 << signo;
167static inline int sigdelset(
sigset_t *set,
int signo)
169 set->
sig[0] &= ~(1 << signo);
180 set->
sig[0] &= ~mask;
185 return (set->
sig[0] & mask) != 0;
188static inline int sigismember(
const sigset_t *set,
int signum)
193static inline int sigisemptyset(
sigset_t *set)
195 return 0 == set->
sig[0];
200 dest->
sig[0] = left->
sig[0] | right->
sig[0];
206 dest->
sig[0] = left->
sig[0] & right->
sig[0];
219#if VSF_LINUX_APPLET_USE_SIGNAL == ENABLED
233# ifndef __VSF_APPLET__
238#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_LINUX_SIGNAL_LIB__))\
239 && VSF_APPLET_CFG_ABI_PATCH != ENABLED && VSF_LINUX_APPLET_USE_SIGNAL == ENABLED
241#ifndef VSF_LINUX_APPLET_SIGNAL_VPLT
242# if VSF_LINUX_USE_APPLET == ENABLED
243# define VSF_LINUX_APPLET_SIGNAL_VPLT \
244 ((vsf_linux_signal_vplt_t *)(VSF_LINUX_APPLET_VPLT->signal_vplt))
246# define VSF_LINUX_APPLET_SIGNAL_VPLT \
247 ((vsf_linux_signal_vplt_t *)vsf_vplt((void *)0))
251#define VSF_LINUX_APPLET_SIGNAL_ENTRY(__NAME) \
252 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_LINUX_APPLET_SIGNAL_VPLT, __NAME)
253#define VSF_LINUX_APPLET_SIGNAL_IMP(...) \
254 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_LINUX_APPLET_SIGNAL_VPLT, __VA_ARGS__)
256VSF_LINUX_APPLET_SIGNAL_IMP(
kill,
int,
pid_t pid,
int sig) {
258 return VSF_LINUX_APPLET_SIGNAL_ENTRY(
kill)(pid,
sig);
262 return VSF_LINUX_APPLET_SIGNAL_ENTRY(
sigprocmask)(how, set, oldset);
266 return VSF_LINUX_APPLET_SIGNAL_ENTRY(
signal)(signum, handler);
270 return VSF_LINUX_APPLET_SIGNAL_ENTRY(
sigaction)(signum, act, oldact);
272VSF_LINUX_APPLET_SIGNAL_IMP(
raise,
int,
int sig) {
274 return VSF_LINUX_APPLET_SIGNAL_ENTRY(
raise)(
sig);
278 return VSF_LINUX_APPLET_SIGNAL_ENTRY(
pthread_sigmask)(how, set, oldset);
282 return VSF_LINUX_APPLET_SIGNAL_ENTRY(
sigwaitinfo)(set, info);
290 return VSF_LINUX_APPLET_SIGNAL_ENTRY(
sigsuspend)(set);
__le16 timeout
Definition ieee80211.h:94
int pid_t
Definition types.h:85
unsigned int uid_t
Definition types.h:90
__TIME_T time_t
Definition types.h:122
#define SIGEV_SIGNAL
Definition signal.h:50
#define sigaddsetmask
Definition signal.h:25
#define sigfillset
Definition signal.h:24
#define _NSIG
Definition signal.h:114
#define SIGEV_THREAD
Definition signal.h:54
#define signal
Definition signal.h:18
#define sigdelsetmask
Definition signal.h:26
int sig_atomic_t
Definition signal.h:41
#define pthread_sigmask
Definition signal.h:28
int sigsuspend(const sigset_t *set)
Definition vsf_linux.c:2622
#define sigaction
Definition signal.h:19
void(* sighandler_t)(int)
Definition signal.h:40
#define sigprocmask
Definition signal.h:20
#define raise
Definition signal.h:21
#define sigtimedwait
Definition signal.h:30
#define sigtestsetmask
Definition signal.h:27
#define sigwaitinfo
Definition signal.h:29
__VSF_VPLT_DECORATOR__ vsf_linux_signal_vplt_t vsf_linux_signal_vplt
Definition vsf_linux.c:4880
#define sigemptyset
Definition signal.h:23
#define SIGEV_NONE
Definition signal.h:52
#define kill
Definition signal.h:17
sighandler_t sa_handler
Definition signal.h:141
sigset_t sa_mask
Definition signal.h:144
int sa_flags
Definition signal.h:145
void * sigev_notify_attributes
Definition signal.h:63
void(* sigev_notify_function)(union sigval)
Definition signal.h:62
int sigev_signo
Definition signal.h:59
union sigval sigev_value
Definition signal.h:60
int sigev_notify
Definition signal.h:58
pid_t sigev_notify_thread_id
Definition signal.h:64
int si_code
Definition signal.h:69
uid_t si_uid
Definition signal.h:71
int si_signo
Definition signal.h:68
pid_t si_pid
Definition signal.h:70
int si_status
Definition signal.h:73
int si_fd
Definition signal.h:74
int si_errno
Definition signal.h:72
long tv_nsec
Definition signal.h:216
time_t tv_sec
Definition signal.h:215
unsigned long sig[_NSIG/(sizeof(unsigned long)<< 3)]
Definition signal.h:135
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sigwaitinfo)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sigsuspend)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sigprocmask)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sigtimedwait)
vsf_vplt_info_t info
Definition signal.h:221
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(raise)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(kill)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(signal)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(sigaction)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(pthread_sigmask)
void * sival_ptr
Definition signal.h:45
int sival_int
Definition signal.h:44
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
#define VSF_APPLET_VPLT_ENTRY_FUNC_TRACE()
Definition vsf_cfg.h:165
int sig
Definition vsf_thread.h:421