doc
Functions

csync file lockling internals

csync internal API

Functions

int csync_lock (CSYNC *ctx, const char *lockfile)
void csync_lock_remove (CSYNC *ctx, const char *lockfile)

Function Documentation

int csync_lock ( CSYNC ctx,
const char *  lockfile 
)

Lock the client if possible.

This functiion tries to lock the client with a lock file.

Parameters:
lockfileThe lock file to create.
Returns:
0 if the lock was successfull, less than 0 if the lock file couldn't be created or if it is already locked.
void csync_lock_remove ( CSYNC ctx,
const char *  lockfile 
)

Remove the lockfile.

Only our own lock can be removed. This function can't remove a lock from another client.

Parameters:
lockfileThe lock file to remove.