]>
Commit | Line | Data |
---|---|---|
1 | .\" | |
2 | .\" Copyright (c) 2007 Apple Inc. All rights reserved. | |
3 | .\" | |
4 | .\" @APPLE_LICENSE_HEADER_START@ | |
5 | .\" | |
6 | .\" This file contains Original Code and/or Modifications of Original Code | |
7 | .\" as defined in and that are subject to the Apple Public Source License | |
8 | .\" Version 2.0 (the 'License'). You may not use this file except in | |
9 | .\" compliance with the License. Please obtain a copy of the License at | |
10 | .\" http://www.opensource.apple.com/apsl/ and read it before using this | |
11 | .\" file. | |
12 | .\" | |
13 | .\" The Original Code and all software distributed under the License are | |
14 | .\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
15 | .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
16 | .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
17 | .\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
18 | .\" Please see the License for the specific language governing rights and | |
19 | .\" limitations under the License. | |
20 | .\" | |
21 | .\" @APPLE_LICENSE_HEADER_END@ | |
22 | .\" | |
23 | .Dd January 9, 2007 | |
24 | .Dt NFSCLNT 2 | |
25 | .Os | |
26 | .Sh NAME | |
27 | .Nm nfsclnt | |
28 | .Nd NFS client services | |
29 | .Sh SYNOPSIS | |
30 | .Fd #include <unistd.h> | |
31 | .Fd #include <nfs/nfs.h> | |
32 | .Ft int | |
33 | .Fn nfsclnt "int flags" "void *argstructp" | |
34 | .Sh DESCRIPTION | |
35 | The | |
36 | .Fn nfsclnt | |
37 | function is used by the NFS client daemons to pass information into and out | |
38 | of the kernel. | |
39 | The | |
40 | .Fa flags | |
41 | argument consists of several bits that show what action is to be taken | |
42 | once in the kernel and the | |
43 | .Fa argstructp | |
44 | points to any corresponding data that the action may require. | |
45 | .Pp | |
46 | .Xr rpc.lockd 8 | |
47 | calls | |
48 | .Fn nfsclnt | |
49 | with the flag | |
50 | .Dv NFSCLNT_LOCKDANS | |
51 | and a pointer to a | |
52 | .Bd -literal | |
53 | struct lockd_ans { | |
54 | int la_version; /* lockd_ans version */ | |
55 | int la_errno; /* return status */ | |
56 | u_int64_t la_xid; /* unique message transaction ID */ | |
57 | int la_flags; /* answer flags */ | |
58 | pid_t la_pid; /* pid of lock requester/owner */ | |
59 | off_t la_start; /* lock starting offset */ | |
60 | off_t la_len; /* lock length */ | |
61 | int la_fh_len; /* The file handle length. */ | |
62 | u_int8_t la_fh[NFSV3_MAX_FH_SIZE];/* The file handle. */ | |
63 | }; | |
64 | .Ed | |
65 | .sp | |
66 | to pass the response to an NFS file locking request back | |
67 | into the kernel. | |
68 | .Sh RETURN VALUES | |
69 | Upon successful completion, a value of 0 is returned. Otherwise, -1 | |
70 | is returned and the global variable | |
71 | .Va errno | |
72 | is set to specify the error. | |
73 | .Sh ERRORS | |
74 | .Bl -tag -width Er | |
75 | .It Bq Er EPERM | |
76 | The caller is not the super-user. | |
77 | .It Bq Er EINVAL | |
78 | The action specified by the | |
79 | .Fa flags | |
80 | argument was not valid. | |
81 | .It Bq EFAULT | |
82 | .Fa argstructp | |
83 | points to an invalid address. | |
84 | .It Bq EPIPE | |
85 | The response doesn't match any currently-outstanding lock request. | |
86 | .El | |
87 | .Sh SEE ALSO | |
88 | .Xr rpc.lockd 8 | |
89 | .Sh BUGS | |
90 | The | |
91 | .Nm nfsclnt | |
92 | system call is designed specifically for the | |
93 | .Tn NFS | |
94 | client daemons and as such is specific to their requirements. Several | |
95 | fields of the argument structures are assumed to be valid, such that | |
96 | .Nm nfsclnt | |
97 | must be used with extreme care. |