summaryrefslogtreecommitdiffstats
path: root/libdaemon/dfork.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-04-25 15:38:35 +0000
committerLennart Poettering <lennart@poettering.net>2008-04-25 15:38:35 +0000
commitd05525e4181e5ae14ac6bf7d7b39eaf4ee33361f (patch)
tree57ca4fde6799cc90e1c0a386309ffc392c2b2a4e /libdaemon/dfork.h
parentc83449ec66b5e4dd8a52143ac3d166d40e88a233 (diff)
add API to block/reset signals
git-svn-id: file:///home/lennart/svn/public/libdaemon/trunk@139 153bfa13-eec0-0310-be40-b0cb6a0e1b4b
Diffstat (limited to 'libdaemon/dfork.h')
-rw-r--r--libdaemon/dfork.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/libdaemon/dfork.h b/libdaemon/dfork.h
index fcb32c3..7d9b62a 100644
--- a/libdaemon/dfork.h
+++ b/libdaemon/dfork.h
@@ -27,11 +27,11 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
/** \mainpage libdaemon
*
* libdaemon
- *
+ *
* For a brief explanation of libdaemons's purpose, have a look on the
* README file. Thank you!
*
@@ -43,7 +43,7 @@ extern "C" {
/** \file
*
- * Contains an API for doing a daemonizing fork().
+ * Contains an API for doing a daemonizing fork().
*
* You may daemonize by calling daemon_fork(), a function similar to
* the plain fork(). If you want to return a return value of the
@@ -100,13 +100,39 @@ int daemon_retval_wait(int timeout);
*/
int daemon_retval_send(int s);
+/** This variable is defined to 1 iff daemon_close_all() and daemon_close_allv() are supported.*/
+#define DAEMON_CLOSE_ALL_AVAILABLE 1
+
/** Close all file descriptors except those passed. List needs to be
* terminated by -1. FDs 0, 1, 2 will be kept open anyway. */
int daemon_close_all(int except_fd, ...);
-/** Same as daemon_close_all but takes an array of fds, terminated by -1 */
+/** Same as daemon_close_all but takes an array of fds, terminated by
+ * -1 */
int daemon_close_allv(const int except_fds[]);
+/** This variable is defined to 1 iff daemon_unblock_sigs() and daemon_unblock_sigsv() are supported.*/
+#define DAEMON_UNBLOCK_SIGS_AVAILABLE 1
+
+/** Unblock all signals except those passed. List needs to be
+ * terminated by -1. */
+int daemon_unblock_sigs(int except, ...);
+
+/** Same as daemon_unblock_sigs() but takes an array of signals,
+ * terminated by -1 */
+int daemon_unblock_sigsv(const int except[]);
+
+/** This variable is defined to 1 iff daemon_reset_sigs() and daemon_reset_sigsv() are supported.*/
+#define DAEMON_RESET_SIGS_AVAILABLE 1
+
+/** Reset all signal handlers except those passed. List needs to be
+ * terminated by -1. */
+int daemon_reset_sigs(int except, ...);
+
+/** Same as daemon_reset_sigs() but takes an array of signals,
+ * terminated by -1 */
+int daemon_reset_sigsv(const int except[]);
+
#ifdef __cplusplus
}
#endif