Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef __ASM_GENERIC_SIGNAL_DEFS_H
0003 #define __ASM_GENERIC_SIGNAL_DEFS_H
0004 
0005 #include <linux/compiler.h>
0006 
0007 /*
0008  * SA_FLAGS values:
0009  *
0010  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
0011  * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
0012  * SA_SIGINFO delivers the signal with SIGINFO structs.
0013  * SA_ONSTACK indicates that a registered stack_t will be used.
0014  * SA_RESTART flag to get restarting signals (which were the default long ago)
0015  * SA_NODEFER prevents the current signal from being masked in the handler.
0016  * SA_RESETHAND clears the handler when the signal is delivered.
0017  * SA_UNSUPPORTED is a flag bit that will never be supported. Kernels from
0018  * before the introduction of SA_UNSUPPORTED did not clear unknown bits from
0019  * sa_flags when read using the oldact argument to sigaction and rt_sigaction,
0020  * so this bit allows flag bit support to be detected from userspace while
0021  * allowing an old kernel to be distinguished from a kernel that supports every
0022  * flag bit.
0023  * SA_EXPOSE_TAGBITS exposes an architecture-defined set of tag bits in
0024  * siginfo.si_addr.
0025  *
0026  * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
0027  * Unix names RESETHAND and NODEFER respectively.
0028  */
0029 #ifndef SA_NOCLDSTOP
0030 #define SA_NOCLDSTOP    0x00000001
0031 #endif
0032 #ifndef SA_NOCLDWAIT
0033 #define SA_NOCLDWAIT    0x00000002
0034 #endif
0035 #ifndef SA_SIGINFO
0036 #define SA_SIGINFO  0x00000004
0037 #endif
0038 /* 0x00000008 used on alpha, mips, parisc */
0039 /* 0x00000010 used on alpha, parisc */
0040 /* 0x00000020 used on alpha, parisc, sparc */
0041 /* 0x00000040 used on alpha, parisc */
0042 /* 0x00000080 used on parisc */
0043 /* 0x00000100 used on sparc */
0044 /* 0x00000200 used on sparc */
0045 #define SA_UNSUPPORTED  0x00000400
0046 #define SA_EXPOSE_TAGBITS   0x00000800
0047 /* 0x00010000 used on mips */
0048 /* 0x00800000 used for internal SA_IMMUTABLE */
0049 /* 0x01000000 used on x86 */
0050 /* 0x02000000 used on x86 */
0051 /*
0052  * New architectures should not define the obsolete
0053  *  SA_RESTORER 0x04000000
0054  */
0055 #ifndef SA_ONSTACK
0056 #define SA_ONSTACK  0x08000000
0057 #endif
0058 #ifndef SA_RESTART
0059 #define SA_RESTART  0x10000000
0060 #endif
0061 #ifndef SA_NODEFER
0062 #define SA_NODEFER  0x40000000
0063 #endif
0064 #ifndef SA_RESETHAND
0065 #define SA_RESETHAND    0x80000000
0066 #endif
0067 
0068 #define SA_NOMASK   SA_NODEFER
0069 #define SA_ONESHOT  SA_RESETHAND
0070 
0071 #ifndef SIG_BLOCK
0072 #define SIG_BLOCK          0    /* for blocking signals */
0073 #endif
0074 #ifndef SIG_UNBLOCK
0075 #define SIG_UNBLOCK        1    /* for unblocking signals */
0076 #endif
0077 #ifndef SIG_SETMASK
0078 #define SIG_SETMASK        2    /* for setting the signal mask */
0079 #endif
0080 
0081 #ifndef __ASSEMBLY__
0082 typedef void __signalfn_t(int);
0083 typedef __signalfn_t __user *__sighandler_t;
0084 
0085 typedef void __restorefn_t(void);
0086 typedef __restorefn_t __user *__sigrestore_t;
0087 
0088 #define SIG_DFL ((__force __sighandler_t)0) /* default signal handling */
0089 #define SIG_IGN ((__force __sighandler_t)1) /* ignore signal */
0090 #define SIG_ERR ((__force __sighandler_t)-1)    /* error return from signal */
0091 #endif
0092 
0093 #endif /* __ASM_GENERIC_SIGNAL_DEFS_H */