1 /* @(#)klm_prot.x 2.1 88/08/01 4.0 RPCSRC */
2 /* @(#)klm_prot.x 1.7 87/07/08 Copyr 1987 Sun Micro */
5 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
6 * unrestricted use provided that this legend is included on all tape
7 * media and as a part of the software program in whole or part. Users
8 * may copy or modify Sun RPC without charge, but are not authorized
9 * to license or distribute it to anyone else except as part of a product or
10 * program developed by the user.
12 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
13 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
14 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 * Sun RPC is provided with no support and without any obligation on the
17 * part of Sun Microsystems, Inc. to assist in its use, correction,
18 * modification or enhancement.
20 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
21 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
22 * OR ANY PART THEREOF.
24 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
25 * or profits or other special, indirect and consequential damages, even if
26 * Sun has been advised of the possibility of such damages.
28 * Sun Microsystems, Inc.
30 * Mountain View, California 94043
34 * Kernel/lock manager protocol definition
35 * Copyright (C) 1986 Sun Microsystems, Inc.
37 * protocol used between the UNIX kernel (the "client") and the
38 * local lock manager. The local lock manager is a deamon running
42 const LM_MAXSTRLEN = 1024;
45 * lock manager status returns
48 klm_granted = 0, /* lock is granted */
49 klm_denied = 1, /* lock is denied */
50 klm_denied_nolocks = 2, /* no lock entry available */
51 klm_working = 3 /* lock is being processed */
55 * lock manager lock identifier
58 string server_name<LM_MAXSTRLEN>;
59 netobj fh; /* a counted file handle */
60 int pid; /* holder of the lock */
61 unsigned l_offset; /* beginning offset of the lock */
62 unsigned l_len; /* byte length of the lock;
63 * zero means through end of file */
67 * lock holder identifier
70 bool exclusive; /* FALSE if shared lock */
71 int svid; /* holder of the lock (pid) */
72 unsigned l_offset; /* beginning offset of the lock */
73 unsigned l_len; /* byte length of the lock;
74 * zero means through end of file */
78 * reply to KLM_LOCK / KLM_UNLOCK / KLM_CANCEL
85 * reply to a KLM_TEST call
87 union klm_testrply switch (klm_stats stat) {
89 struct klm_holder holder;
90 default: /* All other cases return no arguments */
96 * arguments to KLM_LOCK
101 struct klm_lock alock;
105 * arguments to KLM_TEST
107 struct klm_testargs {
109 struct klm_lock alock;
113 * arguments to KLM_UNLOCK
115 struct klm_unlockargs {
116 struct klm_lock alock;
122 klm_testrply KLM_TEST (struct klm_testargs) = 1;
124 klm_stat KLM_LOCK (struct klm_lockargs) = 2;
126 klm_stat KLM_CANCEL (struct klm_lockargs) = 3;
127 /* klm_granted=> the cancel request fails due to lock is already granted */
128 /* klm_denied=> the cancel request successfully aborts
131 klm_stat KLM_UNLOCK (struct klm_unlockargs) = 4;