aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsserver/util.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-11 05:47:10 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-11 05:47:10 +0200
commit4f8ac368dbead32aaa30684c29df3afa0a8ba17f (patch)
tree60a1007dba7a0f2456c44f7152e68b274f4bb3f2 /src/libmdsserver/util.h
parentm (diff)
downloadmds-4f8ac368dbead32aaa30684c29df3afa0a8ba17f.tar.gz
mds-4f8ac368dbead32aaa30684c29df3afa0a8ba17f.tar.bz2
mds-4f8ac368dbead32aaa30684c29df3afa0a8ba17f.tar.xz
add fork_for_safety option + beginning of kernel-based keyboard
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/libmdsserver/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libmdsserver/util.h b/src/libmdsserver/util.h
index 00dfb58..3220adb 100644
--- a/src/libmdsserver/util.h
+++ b/src/libmdsserver/util.h
@@ -21,6 +21,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <sys/types.h>
/**
@@ -113,6 +114,17 @@ char* full_read(int fd);
*/
int startswith_n(const char* haystack, const char* needle, size_t haystack_n, size_t needle_n) __attribute__((pure));
+/**
+ * Wrapper around `waitpid` that never returns on an interruption unless
+ * it is interrupted 100 times within the same second
+ *
+ * @param pid See description of `pid` in the documentation for `waitpid`
+ * @param pid See description of `status` in the documentation for `waitpid`
+ * @param pid See description of `options` in the documentation for `waitpid`
+ * @return See the documentation for `waitpid`
+ */
+pid_t uninterruptable_waitpid(pid_t pid, int* restrict status, int options);
+
#endif