Article View: vmsnet.misc
Article #87RMS File Lock Questions
From: Sanyee Tang
Date: Sun, 30 Aug 1992 09:36
Date: Sun, 30 Aug 1992 09:36
45 lines
2120 bytes
2120 bytes
I am writing a utility in C to find all RMS locks on a specified file.
The scheme is:
(a) Call SYS$PARSE and SYS$SEARCH to find the 6-byte file ID (field NAM$W_FID)
and device name (field NAM$T_DVI). The file could be specified by a
logical.
(b) Call SYS$GETDVI with item code DVI$_DEVLOCKNAM to find the 16-byte device
lock name for the device name obtained in (a).
(c) Call SYS$ENQ to queue a lock on a resource whose name is concatenated as
RMS$ + file ID + device lock name
and receive a lock-id.
(d) Call SYS$GETLKI with item code LKI$_LOCKS, passing lock-id returned in
(c), in hope to get a list of RMS locks associated with the resource name
in (c).
(e) Print out PID, lock mode and queue for every lock in the list returned
in (d).
I have coded a test program. My questions are:
1) Can the above scheme work? Is the basic idea correct?
2) Apparently I have no access to RMS locks in normal situation. What
happen if I do (c) and (d) in EXEC mode (as same as RMS)? If I queue
a lock in EXEC mode with a valid resource name of a RMS file lock, can
I block locks queued by RMS on the same file? :-)
3) If I shall change mode and call SYS$CMEXEC (or SYS$CMKRNL), what is the
order of the argument list? In the same order as in C or in a reversed
order?
I would like to have your experts' opinions before I go further, I am
a bit anxious about to shut down a busy system unwittingly. Your help is
highly appreciated. I thank Dan Wing, Earl D. Lakia and Martin P.J. Zinser
for their help on a previous request for lock utility.
-- Sanyee Tang
BC Research
Vancouver, Canada
Technical Details
Message-ID:
<14724@mindlink.bc.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!van-bc!rsoft!mindlink!a1155Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!van-bc!rsoft!mindlink!a1155 From: Sanyee_Tang@mindlink.bc.ca (Sanyee Tang) Newsgroups: vmsnet.misc Subject: RMS File Lock Questions Message-ID: <14724@mindlink.bc.ca> Date: 30 Aug 92 09:36:48 GMT Organization: MIND LINK! - British Columbia, Canada Distribution: world Lines: 46