summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-17 18:29:57 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-17 18:29:57 +0000
commit1ec74a114cc4ec5055e7bc45cffda483505d8aba (patch)
treededb2e4597256e25189f428ab1bbcb47f7173a1a /include/sys
parent2bdb28fbe07d0f74c38fb0a3231d8425fdc75777 (diff)
Minimal signal handling interface.
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@49 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/signal.h24
-rw-r--r--include/sys/sysmacros.h1
2 files changed, 25 insertions, 0 deletions
diff --git a/include/sys/signal.h b/include/sys/signal.h
new file mode 100644
index 000000000..120329686
--- /dev/null
+++ b/include/sys/signal.h
@@ -0,0 +1,24 @@
+#ifndef _SPL_SIGNAL_H
+#define _SPL_SIGNAL_H
+
+#define FORREAL 0 /* Usual side-effects */
+#define JUSTLOOKING 1 /* Don't stop the process */
+
+/* The "why" argument indicates the allowable side-effects of the call:
+ *
+ * FORREAL: Extract the next pending signal from p_sig into p_cursig;
+ * stop the process if a stop has been requested or if a traced signal
+ * is pending.
+ *
+ * JUSTLOOKING: Don't stop the process, just indicate whether or not
+ * a signal might be pending (FORREAL is needed to tell for sure).
+ */
+static __inline__ int
+issig(int why)
+{
+ BUG_ON(!(why == FORREAL || why == JUSTLOOKING));
+
+ return signal_pending(current);
+}
+
+#endif /* SPL_SIGNAL_H */
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index eeaedf9cb..83e421b6a 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.h
@@ -8,6 +8,7 @@ extern "C" {
#include <linux/module.h>
#include <sys/varargs.h>
#include <sys/zone.h>
+#include <sys/signal.h>
#ifndef _KERNEL
#define _KERNEL __KERNEL__