libdaemon  0.14
dpid.h
Go to the documentation of this file.
1 #ifndef foodaemonpidhfoo
2 #define foodaemonpidhfoo
3 
4 /***
5  This file is part of libdaemon.
6 
7  Copyright 2003-2008 Lennart Poettering
8 
9  libdaemon is free software; you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as
11  published by the Free Software Foundation, either version 2.1 of the
12  License, or (at your option) any later version.
13 
14  libdaemon is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with libdaemon. If not, see
21  <http://www.gnu.org/licenses/>.
22 ***/
23 
24 #include <sys/types.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
37 typedef const char* (*daemon_pid_file_proc_t)(void);
38 
44 extern const char *daemon_pid_file_ident;
45 
51 
56 const char *daemon_pid_file_proc_default(void);
57 
62 
67 
72 
78 
82 #define DAEMON_PID_FILE_KILL_WAIT_AVAILABLE 1
83 
95 int daemon_pid_file_kill_wait(int s, int m);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif
int daemon_pid_file_create(void)
Creates PID pid file for the current process.
const char *(* daemon_pid_file_proc_t)(void)
Prototype of a function for generating the name of a PID file.
Definition: dpid.h:37
int daemon_pid_file_remove(void)
Removes the PID file of the current process.
const char * daemon_pid_file_proc_default(void)
A function for creating a pid file name from daemon_pid_file_ident.
pid_t daemon_pid_file_is_running(void)
Returns the PID file of a running daemon, if available.
const char * daemon_pid_file_ident
Identification string for the PID file name, only used when daemon_pid_file_proc is set to daemon_pid...
daemon_pid_file_proc_t daemon_pid_file_proc
A function pointer which is used to generate the name of the PID file to manipulate.
int daemon_pid_file_kill(int s)
Kills a running daemon, if available.
int daemon_pid_file_kill_wait(int s, int m)
Similar to daemon_pid_file_kill() but waits until the process died.