file-lock.h revision c2bb1764c359ce85a7f7f789ead11dd613ff9769
02b32cf39a098edf60981fc228e4b034f11f3b90Timo Sirainen/* Lock whole file descriptor. Returns 1 if successful, 0 if lock failed,
02b32cf39a098edf60981fc228e4b034f11f3b90Timo Sirainen or -1 if error. lock_type is F_WRLCK, F_RDLCK or F_UNLCK. */
9e86ad9eb313004cd4c8b5427daeb4c241b57af6Timo Sirainen/* Lock whole file descriptor. Returns 1 if successful, 0 if timeout or
c2bb1764c359ce85a7f7f789ead11dd613ff9769Timo Sirainen -1 if error. When returning 0, errno is also set to EAGAIN. Timeouts after
c2bb1764c359ce85a7f7f789ead11dd613ff9769Timo Sirainen DEFAULT_LOCK_TIMEOUT. */
c2bb1764c359ce85a7f7f789ead11dd613ff9769Timo Sirainen/* Like file_wait_lock(), but you can specify the timout and a function which
c2bb1764c359ce85a7f7f789ead11dd613ff9769Timo Sirainen is called once in a while if waiting takes longer. */
c2bb1764c359ce85a7f7f789ead11dd613ff9769Timo Sirainenint file_wait_lock_full(int fd, int lock_type, unsigned int timeout,
c2bb1764c359ce85a7f7f789ead11dd613ff9769Timo Sirainen void (*func)(unsigned int secs_left, void *context),