RETURN VALUES
uu_unlock returns 0 on success and -1 on failure. uu_lock may return any of the following values:
UU_LOCK_INUSE: The lock is in use by another process.
UU_LOCK_OK: The lock was successfully created.
UU_LOCK_OPEN_ERR: The lock file could not be opened via open(2).
UU_LOCK_READ_ERR: The lock file could not be read via read(2).
UU_LOCK_CREAT_ERR: Cannot create temporary lock file via creat(2).
UU_LOCK_WRITE_ERR: The current process id could not be written to the lock file via a call to write(2).
UU_LOCK_LINK_ERR: Cannot link temporary lock file via link(2).
UU_LOCK_TRY_ERR: Locking attempts are failed after 5 tries.
If a value of UU_LOCK_OK is passed to uu_lockerr, an empty string is returned. Otherwise, a string specifying the reason for failure is returned. uu_lockerr uses the current value of errno to determine the exact error. Care should be made not to allow errno to be changed between calls to uu_lock and uu_lockerr.
uu_lock_txfr may return any of the following values:
UU_LOCK_OK: The transfer was successful. The specified process now holds the device lock.
UU_LOCK_OWNER_ERR: The current process does not already own a lock on the specified device.
UU_LOCK_WRITE_ERR: The new process id could not be written to the lock file via a call to write(2).
ERRORS
If uu_lock returns one of the error values above, the global value errno can be used to determine the cause. Refer to the respective manual pages for further details. uu_unlock will set the global variable errno to reflect the reason that the lock file could not be removed. Refer to the description of unlink(2) for further details.
SEE ALSO
lseek(2), open(2), read(2), write(2)
BUGS