A collection of assert function wrappers.
A wrapper class to provide AutoPtr with reference semantics.
int get_lock_status()
Retrieve lock status.
~PidFileLock()
Destructor.
int write_pid()
Write our process pid to the lock file.
pid_t open_pid_file(const std::string &fname_)
Open pid file in a cross-platform way.
int m_error
Last system call error.
const char * get_error_msg() const
In case of error, return a verbal description of the last error.
PidFileLock()
Constructor.
int get_error() const
Return last errno value.
void log_error(const char *msg_)
Log an error message to the log file and set internal error to errno.
string m_error_msg
Error explanation.
pid_t test_region()
Test if file is unlocked.
string m_filename
Lock file name.
int m_fd
Lock file descriptor.
void dump()
Write the state of the lock to debug file.
bool lock(const string &filename_)
Lock the file.
int lock_region()
Lock the entire file.
int lock_region_exclusive()
Lock the entire file (only under Cygwin).
int unlock_region()
Unlock the entire file.