NLM_SHARE - Share a File
-
-
struct nlm_shareargs {
netobj cookie;
nlm_share share;
bool reclaim;
};
-
-
struct nlm_shareres {
netobj cookie;
nlm_stats stat;
int sequence;
};
-
-
nlm_shareres
NLM_SHARE(nlm_shareargs ) = 20;
This procedure indicates that a client wishes to open a file using the DOS 3.1 and above file-sharing modes.
The file to be opened is "share.fh" for access "share.access" in sharing mode "share.mode". The server will examine any entry sharing reservations for this file to determine whether the share is permitted, that is, it does not conflict with the existing use of the file. If the share can be granted, a sharing reservation is established. If a conflict does exist, the request is rejected immediately. This procedure does not block; it is the responsibility of the client to retry any rejected requests.
If "reclaim" is true, then the server will assume this is a request to re-establish a previous share (for example, after the server has crashed and rebooted). During the grace period the server will only accept shares with "reclaim" set to true.
Once a sharing reservation has been established, the lock manager will make no attempt to verify that the reservation is still valid; if the client host crashes and restarts while the reservation is still in effect, the client must call the NLM_FREE_ALL procedure to release all sharing reservations.
When the procedure returns, "stat" will be set to one of the following values:
- LCK_GRANTED
- Indicates that the procedure completed successfully.
- LCK_DENIED
- Indicates that the procedure failed because the request conflicted with existing sharing reservations for the file.
- LCK_DENIED_NOLOCKS
Indicates that the procedure failed because the server NLM could not allocate the resources needed to process the request.
- LCK_DENIED_GRACE_PERIOD
Indicates that the procedure failed because the server host has recently been rebooted and the server NLM is re-establishing existing locks, and is not yet ready to accept normal service requests.
Contents | Next section | Index |