libtools
daemonize.h
Go to the documentation of this file.
1 
20 #ifndef __TOOLS_DAEMONIZE_H
21 #define __TOOLS_DAEMONIZE_H
22 
23 #include <unistd.h>
24 
40 pid_t daemonize(const char *path, char *const argv[], int nochdir, int noclose);
41 
54 int pidlock_set(const char *path);
55 
66 pid_t pidlock_get(const char *path);
67 
70 #endif /* __TOOLS_DAEMONIZE_H */
pid_t daemonize(const char *path, char *const argv[], int nochdir, int noclose)
run program as daemon
int pidlock_set(const char *path)
try to save pid of calling process to file
pid_t pidlock_get(const char *path)
read pid from file and verify it