Open System Services System Calls Reference Manual (G06.28+)

System Functions (s and S) SPT_LOCKREC(2)
NAME
SPT_LOCKREC - excludes other users from accessing a record in a Guardian disk le
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 lenum,
[ long tag ]
);
PARAMETERS
filenum species the le number of a Guardian disk le open instance that identies the
le containing the record to be locked
tag is for nowait I/O only. The tag value you dene uniquely identies 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 dened either as the opener of the le (identied by lenum) if the le is not audited
or as the transaction (identied by the TRANSID) if the le is audited.
For key-sequenced, relative, and entry-sequenced les, the current position is the record with a
key value that matches exactly the current key value. For unstructured les, the current position
is the relative byte address (RBA) identied 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.
SPT_LOCKREC() cannot be used with queue les.
If the le is already locked by another user, the behavior of the system is specied by the locking
mode. There are two locking modes available:
Default The process requesting the lock is suspended (see the Considerations subsection
of this reference page).
Alternate The lock request is rejected with Guardian le-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.
527186-005 Hewlett-Packard Company 7203