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

PUT_LOCKREC(2) OSS System Calls Reference Manual
NAME
PUT_LOCKREC - Excludes other users from accessing a record in 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_LOCKREC(
short filenum,
long tag);
PARAMETERS
filenum Specifies the file number of a Guardian disk file open instance that identifies the
file containing the record 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_LOCKREC( ) function is a thread-aware version of the Guardian LOCKREC pro-
cedure.
The LOCKREC procedure excludes other users from accessing a record at the current position.
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.
For key-sequenced, relative, and entry-sequenced files, the current position is the record with a
key value that matches exactly the current key value. For unstructured files, the current position
is the relative byte address (RBA) identified by the current-record pointer. If the record is
unlocked when PUT_LOCKREC() is called, the record becomes locked, and the caller contin-
ues executing.
You cannot use PUT_LOCKREC() with queue files.
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 LOCKREC procedure, see the Enscribe Programmers
Guide and the Guardian Programmers 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.
5228 Hewlett-Packard Company 527186-023