Framework for exporting system header to user space (#59)
[lunaix-os.git] / lunaix-os / includes / lunaix / signal.h
index af191af7f891827234e1a2032695341c793526f2..63723254e33681413220267e449acffb8c1ec5a6 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef __LUNAIX_SIGNAL_H
 #define __LUNAIX_SIGNAL_H
 
 #ifndef __LUNAIX_SIGNAL_H
 #define __LUNAIX_SIGNAL_H
 
-#include <usr/lunaix/signal_defs.h>
+#include <lunaix/types.h>
+#include <usr/lunaix/signal.h>
 
 #define _SIG_NUM 16
 
 
 #define _SIG_NUM 16
 
 #define sigset_union(set, set2) ((set) = (set) | (set2))
 #define sigset_intersect(set, set2) ((set) = (set) & (set2))
 
 #define sigset_union(set, set2) ((set) = (set) | (set2))
 #define sigset_intersect(set, set2) ((set) = (set) & (set2))
 
+struct sigact
+{
+    sigset_t sa_mask;
+    void* sa_actor;
+    void* sa_handler;
+    pid_t sender;
+};
+
+struct sigregistry {
+    struct sigact* signals[_SIG_NUM];
+};
+
+struct sigctx
+{
+    sigset_t sig_pending;
+    sigset_t sig_mask;
+    signum_t sig_active;
+    signum_t sig_order[_SIG_NUM];
+};
+
 int
 int
-signal_send(pid_t pid, int signum);
+signal_send(pid_t pid, signum_t signum);
+
+void
+signal_dup_context(struct sigctx* dest_ctx);
+
+void
+signal_dup_registry(struct sigregistry* dest_reg);
+
+void
+signal_reset_context(struct sigctx* sigctx);
+
+void
+signal_reset_registry(struct sigregistry* sigreg);
+
+void
+signal_free_registry(struct sigregistry* sigreg);
 
 #endif /* __LUNAIX_SIGNAL_H */
 
 #endif /* __LUNAIX_SIGNAL_H */