file-lock.h revision d9fdacd5fb3e07997e5c389739d2054f0c8441d8
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen/* Lock the file. Returns 1 if successful, 0 if file is already locked,
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen or -1 if error. lock_type is F_WRLCK or F_RDLCK. */
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainenint file_try_lock(int fd, const char *path, int lock_type,
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen/* Like lock_try_lock(), but return 0 only after having tried to lock for
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen timeout_secs. */
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainenint file_wait_lock(int fd, const char *path, int lock_type,
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen/* Change the lock type. */
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainenint file_lock_try_update(struct file_lock *lock, int lock_type);
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen/* Unlock and free the lock. */
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen/* Free the lock without unlocking it (because you're closing the fd anyway). */