Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
SPT_LOCKREC(2) OSS System Calls Reference Manual
NAME
SPT_LOCKREC - Excludes other users from accessing a record in a Guardian disk file
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <cextdecs.h>]
#include <spthread.h>
short SPT_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 is for nowait input/output (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 SPT_LOCKREC( ) function is the 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 SPT_LOCKREC() is called, the record becomes locked, and the caller contin-
ues executing.
You cannot use SPT_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 Programmer’s
Guide and the Guardian Programmer’s Guide.
7−286 Hewlett-Packard Company 527186-023