Open System Services System Calls Reference Manual (G06.28+)
System Functions (s and S) SPT_UNLOCKFILE(2)
NAME
SPT_UNLOCKFILE - unlocks a disk file and any records in that file currently locked by the
user
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_UNLOCKFILE (
short filenum,
[long tag ]
);
PARAMETERS
filenum specifies the Guardian file number of a Guardian file open
instance for the file that you want unlocked.
tag is 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 SPT_UNLOCKFILE() function is the thread-aware version of the Guardian UNLOCK-
FILE procedure.
The SPT_UNLOCKFILE() function unlocks a disk file and any records in that file currently
locked by the user. The user is defined either as the opener of the file (identified by the filenum
value used) if the file is not audited, or by the transaction (identified by the TRANSID) if the file
is audited. Unlocking a file allows other processes to access the file. This call has no affect on
an audited file that has been modified by the current transaction.
For programming information about the Guardian UNLOCKFILE file-system procedure, see the
Enscribe Programmer’s Guide and the Guardian Programmer’s Guide.
Considerations
Nowait and SPT_UNLOCKFILE()
The SPT_UNLOCKFILE() function must complete with a
corresponding call to the Guardian AWAITIOX procedure when
used with a file that is opened nowait.
Locking queue If any users are queued in the locking queue for the file, the pro-
cess at the head of the locking queue is granted access and is
removed from the queue (the next read or lock request moves to
the head of the queue). If the next user in the locking queue is
waiting to:
• lock the file or lock a record in the file, it is granted the
lock (which excludes other users from accessing the file)
and resumes processing.
527186-005 Hewlett-Packard Company 7−315