dmi_file_unlock

Synopsis

#include <opendmi/utils/file.h>

bool dmi_file_unlock(int fd, off_t size);

Description

The dmi_file_unlock function unlocks size bytes of the file starting at the current offset using lockf(F_ULOCK). It retries automatically if interrupted by a signal (EINTR).

Passing size of 0 unlocks from the current offset to the end of the file.

Parameters

fd

Open file descriptor.

size

Number of bytes to unlock, or 0 to unlock to end of file.

Return value

Returns true if the lock was released, false on error.

Errors

None.

See also

dmi_file_lock, lockf(3)