]> gitweb @ CieloNegro.org - daemon.git/blobdiff - pidfile.h
Done!
[daemon.git] / pidfile.h
diff --git a/pidfile.h b/pidfile.h
new file mode 100644 (file)
index 0000000..3e5a5a0
--- /dev/null
+++ b/pidfile.h
@@ -0,0 +1,20 @@
+#ifndef PIDFILE_H_INCLUDED
+#define PIDFILE_H_INCLUDED
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+struct pidfh {
+    int     pf_fd;
+    char    pf_path[MAXPATHLEN + 1];
+    dev_t   pf_dev;
+    ino_t   pf_ino;
+};
+
+struct pidfh* pidfile_open(const char *path, mode_t mode, pid_t *pidptr);
+int pidfile_write(struct pidfh *pfh);
+int pidfile_close(struct pidfh *pfh);
+int pidfile_remove(struct pidfh *pfh);
+
+#endif