Go to the documentation of this file.
9 #ifndef _POWERDXX_SYS_PIDFILE_HPP_
10 #define _POWERDXX_SYS_PIDFILE_HPP_
62 Pidfile(
char const *
const pfname, mode_t
const mode) :
64 if (this->pfh ==
nullptr) {
pidfh * pidfile_open(const char *, mode_t, pid_t *)
Intercept calls to pidfile_open().
Definition: libloadplay.cpp:1769
int pidfile_remove(pidfh *)
Intercept calls to pidfile_remove().
Definition: libloadplay.cpp:1795
Can be thrown by syscall function wrappers if the function returned with an error.
Definition: error.hpp:26
void write()
Write PID to the file, should be called after daemon().
Definition: pidfile.hpp:92
Wrappers around native system interfaces.
pid_t otherpid
In case of failure to acquire the lock, the PID of the other process holding it is stored here.
Definition: pidfile.hpp:40
~Pidfile()
Removes the pidfile.
Definition: pidfile.hpp:77
int pidfile_write(pidfh *)
Intercept calls to pidfile_write().
Definition: libloadplay.cpp:1779
A wrapper around the pidfile_* family of commands implementing the RAII pattern.
Definition: pidfile.hpp:34
Pidfile(char const *const pfname, mode_t const mode)
Attempts to open the pidfile.
Definition: pidfile.hpp:62
The domain error type.
Definition: pidfile.hpp:28
pid_t other()
Returns the PID of the other process holding the lock.
Definition: pidfile.hpp:84
pidfh * pfh
Pointer to the pidfile state data structure.
Definition: pidfile.hpp:48
Provides system call error handling.