pidfile man page on OpenBSD

Man page or keyword search:  
man Server   11362 pages
apropos Keyword Search (all sections)
Output format
OpenBSD logo
[printable version]

PIDFILE(3)		  OpenBSD Programmer's Manual		    PIDFILE(3)

NAME
     pidfile - write a daemon pid file

SYNOPSIS
     #include <util.h>

     int
     pidfile(const char *basename);

DESCRIPTION
     pidfile() writes a file containing the process ID of the program to the
     /var/run directory.  The file name has the form /var/run/basename.pid.
     If the basename argument is NULL, pidfile will determine the program name
     and use that instead.

     The pid file can be used as a quick reference if the process needs to be
     sent a signal.  When the program exits, the pid file will be removed
     automatically, unless the program receives a fatal signal.

RETURN VALUES
     pidfile() returns 0 on success and -1 on failure.

SEE ALSO
     atexit(3)

HISTORY
     The pidfile function call appeared in OpenBSD 3.0.

CAVEATS
     If pidfile() is called multiple times with different basename, only the
     last pidfile will be removed upon exit.

     pidfile() uses atexit() to ensure the pidfile is unlinked at program
     exit.  However, programs that use the _exit() function (for example, in
     signal handlers) will not trigger this behaviour.

OpenBSD 4.9			 June 26, 2008			   OpenBSD 4.9
[top]

List of man pages available for OpenBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net