FS_LockFile(
PIOREQ pir
)
File record lock and unlock is performed through FS_LockFile. This routine handles the Win32 functions: LockFile(), and UnlockFile(); and INT 21h function: 5Ch.
Lock Type Values:
One of the following types will be specified. |
|
Value | Meaning |
---|---|
LOCK_REGION | Region is to be locked. |
UNLOCK_REGION | Region is to be unlocked. |
Lock Option Values: | |
Value | Meaning |
---|---|
LOCKF_RD | This option specifies that the FSD should implement the special read lock semantics that Netware supports. Look below for more details about this. |
LOCKF_NW | This option is specified if the lock and unlock operations should be implemented as per the Netware semantics. Netware semantics for the lock and unlock operations are different from DOS semantics. |
ir_error | Returns status of the operation ( 0 if no error, errorcode otherwise ). |
Netware has different semantics for the lock and unlock operations. It has a read lock that allows processes to read from the file but not write to the file. There can be multiple, overlapping read locks by different processes on a file. A read lock can be promoted to a write lock provided there are no other read locks by other processes on that region. Similarly, a write lock can be demoted to a read lock. The traditional DOS locking semantics are similar to the Netware write lock semantics. It does not allow overlapping locks on a file and there is no concept of lock promotion or demotion. For additional details on the Netware semantics, please refer to Netware documentation.