Query: pidfile
OS: netbsd
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PIDFILE(3) BSD Library Functions Manual PIDFILE(3)NAMEpidfile -- write a daemon pid fileLIBRARYSystem Utilities Library (libutil, -lutil)SYNOPSIS#include <util.h> int pidfile(const char *path);DESCRIPTIONpidfile() creates a file containing the process ID of the caller program. 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 is removed automatically, unless the program receives a fatal signal. If path is NULL or a plain basename (a name containing no directory components), the pid file is created in the /var/run directory. The file name has the form /var/run/basename.pid. The basename part is either the value of path if it was not NULL, or the program name as returned by getprogname(3) otherwise. If path is an absolute or relative path (i.e. it contains the '/' character), the pid file is created in the provided location. Note that only the first invocation of pidfile() causes a pid file to be written; subsequent invocations have no effect unless a new path is supplied. If called with a new path, pidfile() will remove the old pid file and write the new one.RETURN VALUESpidfile() returns 0 on success and -1 on failure.SEE ALSOatexit(3)HISTORYThe pidfile() function call appeared in NetBSD 1.5. Support for creating pid files in any arbitrary path was added in NetBSD 6.0.BUGSpidfile() uses atexit(3) to ensure the pid file is unlinked at program exit. However, programs that use the _exit(2) function (for example, in signal handlers) will not trigger this behaviour.BSDMarch 23, 2011 BSD
Related Man Pages |
---|
card_eventmgr(1) - centos |
pidfile_fileno(3) - freebsd |
pidfile_close(3) - freebsd |
pidfile_open(3) - freebsd |
casperd(8) - freebsd |
Similar Topics in the Unix Linux Community |
---|
pid differs |
getting the pid of another C program with unix calls |
filtering the rows in a file |
Search and combine fields |
How to figure out a if insensitive file path exists or not? |