![]() |
![]() |
![]() |
Camel Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define CAMEL_LOCK_DOT_RETRY #define CAMEL_LOCK_DOT_DELAY #define CAMEL_LOCK_DOT_STALE #define CAMEL_LOCK_RETRY #define CAMEL_LOCK_DELAY enum CamelLockType; int camel_lock_dot (const char *path, CamelException *ex); int camel_lock_fcntl (int fd, CamelLockType type, CamelException *ex); int camel_lock_flock (int fd, CamelLockType type, CamelException *ex); void camel_unlock_dot (const char *path); void camel_unlock_fcntl (int fd); void camel_unlock_flock (int fd); int camel_lock_folder (const char *path, int fd, CamelLockType type, CamelException *ex); void camel_unlock_folder (const char *path, int fd);
int camel_lock_dot (const char *path, CamelException *ex);
Create an exclusive lock using .lock semantics. All locks are equivalent to write locks (exclusive).
|
|
|
|
Returns : |
-1 on error, sets ex appropriately.
|
int camel_lock_fcntl (int fd, CamelLockType type, CamelException *ex);
Create a lock using fcntl(2).
type
is CAMEL_LOCK_WRITE or CAMEL_LOCK_READ,
to create exclusive or shared read locks
|
|
|
|
|
|
Returns : |
-1 on error. |
int camel_lock_flock (int fd, CamelLockType type, CamelException *ex);
Create a lock using flock(2).
type
is CAMEL_LOCK_WRITE or CAMEL_LOCK_READ,
to create exclusive or shared read locks
|
|
|
|
|
|
Returns : |
-1 on error. |
void camel_unlock_dot (const char *path);
Attempt to unlock a .lock lock.
|
int camel_lock_folder (const char *path, int fd, CamelLockType type, CamelException *ex);
Attempt to lock a folder, multiple attempts will be made using all locking strategies available.
|
Path to the file to lock (used for .locking only). |
|
Open file descriptor of the right type to lock. |
|
Type of lock, CAMEL_LOCK_READ or CAMEL_LOCK_WRITE. |
|
|
Returns : |
-1 on error, ex will describe the locking system that failed.
|