summaryrefslogtreecommitdiff
path: root/include/libc/libc_signal.h
diff options
context:
space:
mode:
authorBernardXiong <[email protected]>2018-03-01 13:36:22 +0800
committerBernardXiong <[email protected]>2018-03-01 13:36:22 +0800
commit38b9ed3118f7df9fd683b9d3bd4425ab604ee2bc (patch)
tree2b7acaf70ec61499d4266d74a8c0551a85260111 /include/libc/libc_signal.h
parentef668bc3aa99992208ba6808fe430e5d00849b2f (diff)
[Kernel] add sigwait implementation
Diffstat (limited to 'include/libc/libc_signal.h')
-rw-r--r--include/libc/libc_signal.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h
index cc4552f990..dabcad1a34 100644
--- a/include/libc/libc_signal.h
+++ b/include/libc/libc_signal.h
@@ -30,6 +30,7 @@
extern "C" {
#endif
+#ifndef HAVE_SYS_SIGNALS
/* Signal Generation and Delivery, P1003.1b-1993, p. 63
NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and
sigev_notify_attributes to the sigevent structure. */
@@ -59,14 +60,15 @@ struct siginfo
union sigval si_value;
};
typedef struct siginfo siginfo_t;
+#endif
-#define SI_USER 0x01 /* Signal sent by kill(). */
-#define SI_QUEUE 0x02 /* Signal sent by sigqueue(). */
-#define SI_TIMER 0x03 /* Signal generated by expiration of a
+#define SI_USER 0x01 /* Signal sent by kill(). */
+#define SI_QUEUE 0x02 /* Signal sent by sigqueue(). */
+#define SI_TIMER 0x03 /* Signal generated by expiration of a
timer set by timer_settime(). */
-#define SI_ASYNCIO 0x04 /* Signal generated by completion of an
- asynchronous I/O request. */
-#define SI_MESGQ 0x05 /* Signal generated by arrival of a
+#define SI_ASYNCIO 0x04 /* Signal generated by completion of an
+ asynchronous I/O request. */
+#define SI_MESGQ 0x05 /* Signal generated by arrival of a
message on an empty message queue. */
#ifdef RT_USING_NEWLIB
@@ -107,17 +109,17 @@ typedef unsigned long sigset_t;
#define SIGRTMAX 31
#define NSIG 32
-#define SIG_SETMASK 0 /* set mask with sigprocmask() */
-#define SIG_BLOCK 1 /* set of signals to block */
-#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
+#define SIG_SETMASK 0 /* set mask with sigprocmask() */
+#define SIG_BLOCK 1 /* set of signals to block */
+#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
typedef void (*_sig_func_ptr)(int);
struct sigaction
{
- _sig_func_ptr sa_handler;
- sigset_t sa_mask;
- int sa_flags;
+ _sig_func_ptr sa_handler;
+ sigset_t sa_mask;
+ int sa_flags;
};
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
@@ -163,17 +165,17 @@ typedef unsigned long sigset_t;
#define SIGRTMAX 31
#define NSIG 32
-#define SIG_SETMASK 0 /* set mask with sigprocmask() */
-#define SIG_BLOCK 1 /* set of signals to block */
-#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
+#define SIG_SETMASK 0 /* set mask with sigprocmask() */
+#define SIG_BLOCK 1 /* set of signals to block */
+#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
typedef void (*_sig_func_ptr)(int);
struct sigaction
{
- _sig_func_ptr sa_handler;
- sigset_t sa_mask;
- int sa_flags;
+ _sig_func_ptr sa_handler;
+ sigset_t sa_mask;
+ int sa_flags;
};
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)