libite 2.6.1
pidfile.c File Reference
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <errno.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

Go to the source code of this file.

Functions

int pidfile (const char *basename)
 

Variables

const char * __pidfile_path = _PATH_VARRUN
 
const char * __pidfile_name = NULL
 
char * __progname
 

Detailed Description

Author
NetBSD Foundation Inc.
Date
1999

Definition in file pidfile.c.

Function Documentation

◆ pidfile()

int pidfile ( const char * basename)

Create or update mtime of process PID file.

Parameters
basenameProgram name, or NULL, may start with '/'

This function is intended to be used by UNIX daemons to save the PID of the main process responsible for handling signals. If basename is NULL the implicit __progname variable from the C-library is used. The basename may also start with '/', in which case it is interpreted as the absolute path to the PID file.

Returns
POSIX OK(0) on success, otherwise non-zero on error.

Definition at line 71 of file pidfile.c.

Variable Documentation

◆ __pidfile_name

const char* __pidfile_name = NULL

Definition at line 57 of file pidfile.c.

◆ __pidfile_path

const char* __pidfile_path = _PATH_VARRUN

Definition at line 56 of file pidfile.c.