wibble 0.1.28
Public Member Functions | Public Attributes
wibble::sys::fs::FileLock Struct Reference

RAII fcntl advisory file lock. More...

#include <filelock.h>

List of all members.

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

Detailed Description

RAII fcntl advisory file lock.

See fcntl(2) for details.


Constructor & Destructor Documentation

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.

Parameters:
writeIf false, use a read lock, else a write lock.

References lock.

wibble::sys::fs::FileLock::~FileLock ( )

Unlocks using the values in lock.

References fd, and lock.


Member Data Documentation

Referenced by ~FileLock().

Referenced by FileLock(), and ~FileLock().


The documentation for this struct was generated from the following files: