Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (n - p) PUT_LOCKFILE(2)
NAME
PUT_LOCKFILE - Excludes other users from accessing a Guardian disk file
LIBRARY
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yputdll
SYNOPSIS
[#include <cextdecs.h>]
#include <pthread.h>
short PUT_LOCKFILE(
short filenum,
long tag);
PARAMETERS
filenum Specifies the file number of a Guardian disk file open instance that identifies the
file to be locked.
tag (Optional) For nowait I/O only. The tag value you define uniquely identifies the
operation associated with this call.
This parameter is supported only for program compatibility; if you provide it, it
is ignored.
DESCRIPTION
The PUT_LOCKFILE() function is a thread-aware version of the Guardian LOCKFILE pro-
cedure.
The PUT_LOCKFILE() function is used to exclude other users from accessing a file (and any
records within that file). The user is defined either as the opener of the file (identified by filenum)
if the file is not audited or as the transaction (identified by the TRANSID) if the file is audited. If
the file is currently unlocked or is locked by the current user when PUT_LOCKFILE() is
called, the file (and all its records) becomes locked, and the caller continues executing. If the file
is already locked by another user, the behavior of the system is specified by the locking mode.
Two locking modes are available:
Default The process requesting the lock is suspended. See the Considerations subsec-
tion of this reference page.
Alternate The lock request is rejected with Guardian file-system error 73. When the alter-
nate locking mode is in effect, the process requesting the lock is not suspended.
See the Considerations subsection of this reference page.
For programming information about the LOCKFILE procedure, see the Enscribe Programmer’s
Guide and the Guardian Programmer’s Guide.
To use this function on systems running H06.21 or later RVUs or J06.10 or later RVUs, you must
perform all of the following tasks:
• Include the pthread.h header file in the application.
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
• Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit applications.
527186-023 Hewlett-Packard Company 5−225