#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.
- Author
- NetBSD Foundation Inc.
- Date
- 1999
- Copyright
- 2-clause BSD License
Definition in file pidfile.c.
◆ pidfile()
int pidfile |
( |
const char * | basename | ) |
|
Create or update mtime of process PID file.
- Parameters
-
basename | Program 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.
◆ __pidfile_name
const char* __pidfile_name = NULL |
◆ __pidfile_path
const char* __pidfile_path = _PATH_VARRUN |