Main Page   File List   Globals   Examples  

dpid.h File Reference

Contains an API for manipulating PID files. More...

#include <sys/types.h>

Go to the source code of this file.

Typedefs

typedef const char *(* daemon_pid_file_proc_t )(void)
 Prototype of a function for generating the name of a PID file.


Functions

const char * daemon_pid_file_proc_default (void)
 A function for creating a pid file name from daemon_pid_file_ident.

int daemon_pid_file_create (void)
 Creates PID pid file for the current process.

int daemon_pid_file_remove (void)
 Removes the PID file of the current process.

pid_t daemon_pid_file_is_running (void)
 Returns the PID file of a running daemon, if available.

int daemon_pid_file_kill (int s)
 Kills a running daemon, if available.


Variables

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_file_proc_default().

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.


Detailed Description

Contains an API for manipulating PID files.

Definition in file dpid.h.


Typedef Documentation

typedef const char*(* daemon_pid_file_proc_t)(void)
 

Prototype of a function for generating the name of a PID file.

Definition at line 31 of file dpid.h.


Function Documentation

int daemon_pid_file_create void   
 

Creates PID pid file for the current process.

Returns:
zero on success, nonzero on failure
Examples:
testd.c.

pid_t daemon_pid_file_is_running void   
 

Returns the PID file of a running daemon, if available.

Returns:
The PID or negative on failure
Examples:
testd.c.

int daemon_pid_file_kill int    s
 

Kills a running daemon, if available.

Parameters:
s  The signal to send
Returns:
zero on success, nonzero on failure
Examples:
testd.c.

const char* daemon_pid_file_proc_default void   
 

A function for creating a pid file name from daemon_pid_file_ident.

Returns:
The PID file path

int daemon_pid_file_remove void   
 

Removes the PID file of the current process.

Returns:
zero on success, nonzero on failure
Examples:
testd.c.


Variable Documentation

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_file_proc_default().

Use daemon_ident_from_argv0() to generate an identification string from argv[0]

Definition at line 38 of file dpid.h.

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.

Points to daemon_pid_file_proc_default() by default.

Definition at line 44 of file dpid.h.


Generated on Thu Jul 10 19:49:51 2003 for libdaemon by doxygen1.2.18