.TH "dpid.h" 3 "Fri Apr 27 2018" "Version 0.14" "libdaemon" \" -*- nroff -*- .ad l .nh .SH NAME dpid.h \- Contains an API for manipulating PID files\&. .SH SYNOPSIS .br .PP \fC#include \fP .br .SS "Macros" .in +1c .ti -1c .RI "#define \fBDAEMON_PID_FILE_KILL_WAIT_AVAILABLE\fP 1" .br .RI "This variable is defined to 1 iff \fBdaemon_pid_file_kill_wait()\fP is supported\&. " .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef const char *(* \fBdaemon_pid_file_proc_t\fP) (void)" .br .RI "Prototype of a function for generating the name of a PID file\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "const char * \fBdaemon_pid_file_proc_default\fP (void)" .br .RI "A function for creating a pid file name from daemon_pid_file_ident\&. " .ti -1c .RI "int \fBdaemon_pid_file_create\fP (void)" .br .RI "Creates PID pid file for the current process\&. " .ti -1c .RI "int \fBdaemon_pid_file_remove\fP (void)" .br .RI "Removes the PID file of the current process\&. " .ti -1c .RI "pid_t \fBdaemon_pid_file_is_running\fP (void)" .br .RI "Returns the PID file of a running daemon, if available\&. " .ti -1c .RI "int \fBdaemon_pid_file_kill\fP (int s)" .br .RI "Kills a running daemon, if available\&. " .ti -1c .RI "int \fBdaemon_pid_file_kill_wait\fP (int s, int m)" .br .RI "Similar to \fBdaemon_pid_file_kill()\fP but waits until the process died\&. " .in -1c .SS "Variables" .in +1c .ti -1c .RI "const char * \fBdaemon_pid_file_ident\fP" .br .RI "Identification string for the PID file name, only used when daemon_pid_file_proc is set to \fBdaemon_pid_file_proc_default()\fP\&. " .ti -1c .RI "\fBdaemon_pid_file_proc_t\fP \fBdaemon_pid_file_proc\fP" .br .RI "A function pointer which is used to generate the name of the PID file to manipulate\&. " .in -1c .SH "Detailed Description" .PP Contains an API for manipulating PID files\&. .PP Definition in file \fBdpid\&.h\fP\&. .SH "Macro Definition Documentation" .PP .SS "#define DAEMON_PID_FILE_KILL_WAIT_AVAILABLE 1" .PP This variable is defined to 1 iff \fBdaemon_pid_file_kill_wait()\fP is supported\&. .PP \fBSince:\fP .RS 4 0\&.3 .RE .PP \fBSee also:\fP .RS 4 \fBdaemon_pid_file_kill_wait()\fP .RE .PP .PP Definition at line 82 of file dpid\&.h\&. .SH "Typedef Documentation" .PP .SS "typedef const char*(* daemon_pid_file_proc_t) (void)" .PP Prototype of a function for generating the name of a PID file\&. .PP Definition at line 37 of file dpid\&.h\&. .SH "Function Documentation" .PP .SS "int daemon_pid_file_create (void)" .PP Creates PID pid file for the current process\&. .PP \fBReturns:\fP .RS 4 zero on success, nonzero on failure .RE .PP .PP \fBExamples: \fP .in +1c \fBtestd\&.c\fP\&. .SS "pid_t daemon_pid_file_is_running (void)" .PP Returns the PID file of a running daemon, if available\&. .PP \fBReturns:\fP .RS 4 The PID or negative on failure .RE .PP .PP \fBExamples: \fP .in +1c \fBtestd\&.c\fP\&. .SS "int daemon_pid_file_kill (int s)" .PP Kills a running daemon, if available\&. .PP \fBParameters:\fP .RS 4 \fIs\fP The signal to send .RE .PP \fBReturns:\fP .RS 4 zero on success, nonzero on failure .RE .PP .SS "int daemon_pid_file_kill_wait (int s, int m)" .PP Similar to \fBdaemon_pid_file_kill()\fP but waits until the process died\&. This functions is new in libdaemon 0\&.3\&. The macro DAEMON_PID_FILE_KILL_WAIT_AVAILABLE is defined iff libdaemon supports this function\&. .PP \fBParameters:\fP .RS 4 \fIs\fP The signal to send .br \fIm\fP Seconds to wait at maximum .RE .PP \fBReturns:\fP .RS 4 zero on success, nonzero on failure (timeout condition is considered a failure) .RE .PP \fBSince:\fP .RS 4 0\&.3 .RE .PP \fBSee also:\fP .RS 4 \fBDAEMON_PID_FILE_KILL_WAIT_AVAILABLE\fP .RE .PP .PP \fBExamples: \fP .in +1c \fBtestd\&.c\fP\&. .SS "const char* daemon_pid_file_proc_default (void)" .PP A function for creating a pid file name from daemon_pid_file_ident\&. .PP \fBReturns:\fP .RS 4 The PID file path .RE .PP .SS "int daemon_pid_file_remove (void)" .PP Removes the PID file of the current process\&. .PP \fBReturns:\fP .RS 4 zero on success, nonzero on failure .RE .PP .PP \fBExamples: \fP .in +1c \fBtestd\&.c\fP\&. .SH "Variable Documentation" .PP .SS "const char* daemon_pid_file_ident" .PP Identification string for the PID file name, only used when daemon_pid_file_proc is set to \fBdaemon_pid_file_proc_default()\fP\&. Use \fBdaemon_ident_from_argv0()\fP to generate an identification string from argv[0] .PP \fBExamples: \fP .in +1c \fBtestd\&.c\fP\&. .SS "\fBdaemon_pid_file_proc_t\fP daemon_pid_file_proc" .PP A function pointer which is used to generate the name of the PID file to manipulate\&. Points to \fBdaemon_pid_file_proc_default()\fP by default\&. .SH "Author" .PP Generated automatically by Doxygen for libdaemon from the source code\&.