Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (n - p) PUT_LOCKFILE(2)
For nonaudited files, a deadlock condition (a permanent suspension of your
application) occurs if PUT_READX() or PUT_READUPDATEX( ) is called
by the process that has a record locked with a file number other than that sup-
plied in the PUT_READX() or PUT_READUPDATEX( ) call. For an explana-
tion of multiple opens by the same process, see the PUT_FILE_OPEN_(2)
reference page either online or in the Open System Services System Calls Refer-
ence Manual.
Accessing a locked file
If the file is locked by a user other than the caller at the time of the call, the call
is rejected with Guardian file-system error 73 (file is locked) when:
PUT_READX() or PUT_READUPDATEX() is called, and the alternate lock-
ing mode is in effect.
PUT_WRITEX(), WRITEUPDATE, or PUT_CONTROL() is called.
A count of the locks in effect is not maintained. Multiple locks can be unlocked with one call to
PUT_UNLOCKFILE().
Use on OSS Objects
This procedure operates only on Guardian objects. If an OSS file is specified, Guardian file-
system error 2 occurs.
RETURN VALUES
The PUT_LOCKFILE() function returns 0 (zero) upon successful completion. Otherwise, this
function returns a nonzero Guardian file-system error number that indicates the outcome of the
operation.
For information about Guardian file-system error numbers, see the Guardian Procedure Errors
and Messages Manual.
ERRORS
None. This function does not set the errno variable.
RELATED INFORMATION
Functions: PUT_CANCEL(2), PUT_CONTROL(2), PUT_FILE_CLOSE_(2),
PUT_FILE_OPEN_(2), PUT_LOCKREC(2), PUT_READLOCKX(2),
PUT_READUPDATELOCKX(2), PUT_READUPDATEX(2), PUT_READX(2),
PUT_SETMODE(2), PUT_UNLOCKFILE(2), PUT_UNLOCKREC(2),
PUT_WRITEREADX(2), PUT_WRITEUPDATEUNLOCKX(2),
PUT_WRITEUPDATEX(2), PUT_WRITEX(2).
527186-023 Hewlett-Packard Company 5227