RAII fcntl advisory file lock. More...
#include <filelock.h>
Public Member Functions | |
FileLock (int fd, short l_type, short l_whence=SEEK_SET, off_t l_start=0, off_t l_len=0) | |
Create the lockfile with the given name. | |
~FileLock () | |
Unlocks using the values in lock. | |
Public Attributes | |
int | fd |
struct flock | lock |
RAII fcntl advisory file lock.
See fcntl(2) for details.
wibble::sys::fs::FileLock::FileLock | ( | int | fd, | |
short | l_type, | |||
short | l_whence = SEEK_SET , |
|||
off_t | l_start = 0 , |
|||
off_t | l_len = 0 | |||
) |
Create the lockfile with the given name.
lock will be initialised with the parameters and used to unlock in the destructor. Please feel free to change the contents of the lock structure if you need a different part to be unlocked.
write | If false, use a read lock, else a write lock. |
References lock.
Referenced by ~FileLock().
struct flock wibble::sys::fs::FileLock::lock |
Referenced by FileLock(), and ~FileLock().