file-lock.h revision 9e86ad9eb313004cd4c8b5427daeb4c241b57af6
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen/* Lock whole file descriptor. Returns 1 if successful, 0 if lock failed,
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen or -1 if error. lock_type is F_WRLCK, F_RDLCK or F_UNLCK. */
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen/* Lock whole file descriptor. Returns 1 if successful, 0 if timeout or
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen -1 if error. When returning 0, errno is also set to EAGAIN.
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen NOTE: timeout uses SIGALRM and resets it at the end. */
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainenint file_wait_lock(int fd, int lock_type, unsigned int timeout);