about summary refs log tree commit diff
path: root/include/signal.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-29 13:01:25 -0400
committerRich Felker <dalias@aerifal.cx>2011-03-29 13:01:25 -0400
commit80c4dcd2535a2d7f01eb539b0358dc51b0c0e122 (patch)
tree45bd30741a6f37bd0191467663dfbe5fb108c471 /include/signal.h
parentbf619d82c82052741323aa63c107fbd346c8aaba (diff)
downloadmusl-80c4dcd2535a2d7f01eb539b0358dc51b0c0e122.tar.gz
musl-80c4dcd2535a2d7f01eb539b0358dc51b0c0e122.tar.xz
musl-80c4dcd2535a2d7f01eb539b0358dc51b0c0e122.zip
implement POSIX timers
this implementation is superior to the glibc/nptl implementation, in
that it gives true realtime behavior. there is no risk of timer
expiration events being lost due to failed thread creation or failed
malloc, because the thread is created as time creation time, and
reused until the timer is deleted.
Diffstat (limited to 'include/signal.h')
-rw-r--r--include/signal.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/signal.h b/include/signal.h
index f5e87c78..6116fb43 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -17,6 +17,7 @@ extern "C" {
 #define __NEED_uid_t
 #define __NEED_struct_timespec
 #define __NEED_pthread_t
+#define __NEED_pthread_attr_t
 #define __NEED_time_t
 #define __NEED_clock_t
 #define __NEED_sigset_t
@@ -24,8 +25,7 @@ extern "C" {
 
 #include <bits/alltypes.h>
 
-struct sigaction
-{
+struct sigaction {
 	union {
 		void (*sa_handler)(int);
 		void (*sa_sigaction)(int, siginfo_t *, void *);
@@ -37,19 +37,29 @@ struct sigaction
 #define sa_handler   __sa_handler.sa_handler
 #define sa_sigaction __sa_handler.sa_sigaction
 
-typedef struct
-{
+typedef struct {
 	void *ss_sp;
 	int ss_flags;
 	size_t ss_size;
 } stack_t;
 
-union sigval
-{
+union sigval {
 	int sival_int;
 	void *sival_ptr;
 };
 
+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
+
 int __libc_current_sigrtmin(void);
 int __libc_current_sigrtmax(void);