#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 <string.h>
#include <unistd.h>
|
int | pidfile (const char *basename) |
| Create or update mtime of process PID file. More...
|
|
|
const char * | __pidfile_path = _PATH_VARRUN |
|
const char * | __pidfile_name = NULL |
|
char * | __progname |
|
- Author
- NetBSD Foundation Inc.
- Date
- 1999
- Copyright
- 2-clause BSD License
◆ 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.