]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/doc/psd/27.nfsrpc/nfs.rfc.ms
unbound: Vendor import 1.18.0
[FreeBSD/FreeBSD.git] / share / doc / psd / 27.nfsrpc / nfs.rfc.ms
1 .\"
2 .\" Must use  --  tbl  --  with this one
3 .\"
4 .\" @(#)nfs.rfc.ms      2.2 88/08/05 4.0 RPCSRC
5 .\"
6 .de BT
7 .if \\n%=1 .tl ''- % -''
8 ..
9 .ND
10 .\" prevent excess underlining in nroff
11 .if n .fp 2 R
12 .OH 'Network File System: Version 2 Protocol Specification''Page %'
13 .EH 'Page %''Network File System: Version 2 Protocol Specification'
14 .if \n%=1 .bp
15 .SH
16 \&Network File System: Version 2 Protocol Specification
17 .IX NFS "" "" "" PAGE MAJOR
18 .IX "Network File System" "" "" "" PAGE MAJOR
19 .IX NFS "version-2 protocol specification"
20 .IX "Network File System" "version-2 protocol specification"
21 .LP
22 .NH 0
23 \&Status of this Standard
24 .LP
25 Note: This document specifies a protocol that Sun Microsystems, Inc.,
26 and others are using.  It specifies it in standard ARPA RFC form.
27 .NH 1
28 \&Introduction
29 .IX NFS introduction
30 .LP
31 The Sun Network Filesystem (NFS) protocol provides transparent remote 
32 access to shared filesystems over local area networks.  The NFS 
33 protocol is designed to be machine, operating system, network architecture, 
34 and transport protocol independent.  This independence is 
35 achieved through the use of Remote Procedure Call (RPC) primitives 
36 built on top of an External Data Representation (XDR).  Implementations
37 exist for a variety of machines, from personal computers to
38 supercomputers.
39 .LP
40 The supporting mount protocol allows the server to hand out remote
41 access privileges to a restricted set of clients.  It performs the
42 operating system-specific functions that allow, for example, to
43 attach remote directory trees to some local file system.
44 .NH 2
45 \&Remote Procedure Call
46 .IX "Remote Procedure Call"
47 .LP
48 Sun's remote procedure call specification provides a procedure-
49 oriented interface to remote services.  Each server supplies a
50 program that is a set of procedures.  NFS is one such "program".
51 The combination of host address, program number, and procedure
52 number specifies one remote service procedure.  RPC does not depend
53 on services provided by specific protocols, so it can be used with
54 any underlying transport protocol.  See the
55 .I "Remote Procedure Calls: Protocol Specification"
56 chapter of this manual.
57 .NH 2
58 \&External Data Representation
59 .IX "External Data Representation"
60 .LP
61 The External Data Representation (XDR) standard provides a common
62 way of representing a set of data types over a network.  
63 The NFS
64 Protocol Specification is written using the RPC data description
65 language.  
66 For more information, see the
67 .I " External Data Representation Standard: Protocol Specification."  
68 Sun provides implementations of XDR and
69 RPC,  but NFS does not require their use.  Any software that
70 provides equivalent functionality can be used, and if the encoding
71 is exactly the same it can interoperate with other implementations
72 of NFS.
73 .NH 2
74 \&Stateless Servers
75 .IX "stateless servers"
76 .IX servers stateless
77 .LP
78 The NFS protocol is stateless.  That is, a server does not need to
79 maintain any extra state information about any of its clients in
80 order to function correctly.  Stateless servers have a distinct
81 advantage over stateful servers in the event of a failure.  With
82 stateless servers, a client need only retry a request until the
83 server responds; it does not even need to know that the server has
84 crashed, or the network temporarily went down.  The client of a
85 stateful server, on the other hand, needs to either detect a server
86 crash and rebuild the server's state when it comes back up, or
87 cause client operations to fail.
88 .LP
89 This may not sound like an important issue, but it affects the
90 protocol in some unexpected ways.  We feel that it is worth a bit
91 of extra complexity in the protocol to be able to write very simple
92 servers that do not require fancy crash recovery.
93 .LP
94 On the other hand, NFS deals with objects such as files and
95 directories that inherently have state -- what good would a file be
96 if it did not keep its contents intact?  The goal is to not
97 introduce any extra state in the protocol itself.  Another way to
98 simplify recovery is by making operations "idempotent" whenever
99 possible (so that they can potentially be repeated).
100 .NH 1
101 \&NFS Protocol Definition
102 .IX NFS "protocol definition"
103 .IX NFS protocol
104 .LP
105 Servers have been known to change over time, and so can the
106 protocol that they use. So RPC provides a version number with each
107 RPC request. This RFC describes version two of the NFS protocol.
108 Even in the second version, there are various obsolete procedures
109 and parameters, which will be removed in later versions. An RFC
110 for version three of the NFS protocol is currently under
111 preparation.
112 .NH 2
113 \&File System Model
114 .IX filesystem model
115 .LP
116 NFS assumes a file system that is hierarchical, with directories as
117 all but the bottom-level files.  Each entry in a directory (file,
118 directory, device, etc.)  has a string name.  Different operating
119 systems may have restrictions on the depth of the tree or the names
120 used, as well as using different syntax to represent the "pathname",
121 which is the concatenation of all the "components" (directory and
122 file names) in the name.  A "file system" is a tree on a single
123 server (usually a single disk or physical partition) with a specified
124 "root".  Some operating systems provide a "mount" operation to make
125 all file systems appear as a single tree, while others maintain a
126 "forest" of file systems.  Files are unstructured streams of
127 uninterpreted bytes.  Version 3 of NFS uses a slightly more general
128 file system model.
129 .LP
130 NFS looks up one component of a pathname at a time.  It may not be
131 obvious why it does not just take the whole pathname, traipse down
132 the directories, and return a file handle when it is done.  There are
133 several good reasons not to do this.  First, pathnames need
134 separators between the directory components, and different operating
135 systems use different separators.  We could define a Network Standard
136 Pathname Representation, but then every pathname would have to be
137 parsed and converted at each end.  Other issues are discussed in
138 \fINFS Implementation Issues\fP below.
139 .LP
140 Although files and directories are similar objects in many ways,
141 different procedures are used to read directories and files.  This
142 provides a network standard format for representing directories.  The
143 same argument as above could have been used to justify a procedure
144 that returns only one directory entry per call.  The problem is
145 efficiency.  Directories can contain many entries, and a remote call
146 to return each would be just too slow.
147 .NH 2
148 \&RPC Information
149 .IX NFS "RPC information"
150 .IP \fIAuthentication\fP
151 The   NFS  service uses 
152 .I AUTH_UNIX ,
153 .I AUTH_DES ,
154 or 
155 .I AUTH_SHORT 
156 style
157 authentication, except in  the  NULL procedure where   
158 .I AUTH_NONE 
159 is also allowed.
160 .IP "\fITransport Protocols\fP"
161 NFS currently is supported on UDP/IP only.  
162 .IP "\fIPort Number\fP"
163 The NFS protocol currently uses the UDP port number 2049.  This is
164 not an officially assigned port, so  later versions of the protocol
165 use the \*QPortmapping\*U facility of RPC.
166 .NH 2
167 \&Sizes of XDR Structures
168 .IX "XDR structure sizes"
169 .LP
170 These are the sizes, given in decimal bytes, of various XDR
171 structures used in the protocol:
172 .DS
173 /* \fIThe maximum number of bytes of data in a READ or WRITE request\fP  */
174 const MAXDATA = 8192;
175
176 /* \fIThe maximum number of bytes in a pathname argument\fP */
177 const MAXPATHLEN = 1024;
178
179 /* \fIThe maximum number of bytes in a file name argument\fP */
180 const MAXNAMLEN = 255;
181
182 /* \fIThe size in bytes of the opaque "cookie" passed by READDIR\fP */
183 const COOKIESIZE  = 4;
184
185 /* \fIThe size in bytes of the opaque file handle\fP */
186 const FHSIZE = 32;
187 .DE
188 .NH 2
189 \&Basic Data Types
190 .IX "NFS data types"
191 .IX NFS "basic data types"
192 .LP
193 The following XDR  definitions are basic  structures and types used
194 in other structures described further on.
195 .KS
196 .NH 3
197 \&stat
198 .IX "NFS data types" stat "" \fIstat\fP
199 .DS
200 enum stat {
201         NFS_OK = 0,
202         NFSERR_PERM=1,
203         NFSERR_NOENT=2,
204         NFSERR_IO=5,
205         NFSERR_NXIO=6,
206         NFSERR_ACCES=13,
207         NFSERR_EXIST=17,
208         NFSERR_NODEV=19,
209         NFSERR_NOTDIR=20,
210         NFSERR_ISDIR=21,
211         NFSERR_FBIG=27,
212         NFSERR_NOSPC=28,
213         NFSERR_ROFS=30,
214         NFSERR_NAMETOOLONG=63,
215         NFSERR_NOTEMPTY=66,
216         NFSERR_DQUOT=69,
217         NFSERR_STALE=70,
218         NFSERR_WFLUSH=99
219 };
220 .DE
221 .KE
222 .LP
223 The 
224 .I stat 
225 type  is returned with every  procedure's  results.   A
226 value of 
227 .I NFS_OK 
228 indicates that the  call completed successfully and
229 the  results are  valid.  The  other  values indicate  some kind of
230 error  occurred on the  server  side  during the servicing   of the
231 procedure.  The error values are derived from UNIX error numbers.
232 .IP \fBNFSERR_PERM\fP:
233 Not owner.  The caller does not have correct ownership
234 to perform the requested operation.
235 .IP \fBNFSERR_NOENT\fP:
236 No such file or directory.    The file or directory
237 specified does not exist.
238 .IP \fBNFSERR_IO\fP:
239 Some sort of hard  error occurred when the operation was
240 in progress.  This could be a disk error, for example.
241 .IP \fBNFSERR_NXIO\fP:
242 No such device or address.
243 .IP \fBNFSERR_ACCES\fP:
244 Permission  denied.  The  caller does  not  have the
245 correct permission to perform the requested operation.
246 .IP \fBNFSERR_EXIST\fP:
247 File exists.  The file specified already exists.
248 .IP \fBNFSERR_NODEV\fP:
249 No such device.
250 .IP \fBNFSERR_NOTDIR\fP:
251 Not   a  directory.    The  caller  specified   a
252 non-directory in a directory operation.
253 .IP \fBNFSERR_ISDIR\fP:
254 Is a directory.  The caller specified  a directory in
255 a non- directory operation.
256 .IP \fBNFSERR_FBIG\fP:
257 File too large.   The  operation caused a file to grow
258 beyond the server's limit.
259 .IP \fBNFSERR_NOSPC\fP:
260 No space left on  device.   The operation caused the
261 server's filesystem to reach its limit.
262 .IP \fBNFSERR_ROFS\fP:
263 Read-only filesystem.  Write attempted on a read-only filesystem.
264 .IP \fBNFSERR_NAMETOOLONG\fP:
265 File name   too   long.  The file  name  in  an operation was too long.
266 .IP \fBNFSERR_NOTEMPTY\fP:
267 Directory   not empty.  Attempted  to   remove  a
268 directory that was not empty.
269 .IP \fBNFSERR_DQUOT\fP:
270 Disk quota exceeded.  The client's disk  quota on the
271 server has been exceeded.
272 .IP \fBNFSERR_STALE\fP:
273 The  "fhandle" given in   the arguments was invalid.
274 That is, the file referred to by that file handle no longer exists,
275 or access to it has been revoked.
276 .IP \fBNFSERR_WFLUSH\fP:
277 The server's  write cache  used  in the
278 .I WRITECACHE 
279 call got flushed to disk.
280 .LP
281 .KS
282 .NH 3
283 \&ftype
284 .IX "NFS data types" ftype "" \fIftype\fP
285 .DS
286 enum ftype {
287         NFNON = 0,
288         NFREG = 1,
289         NFDIR = 2,
290         NFBLK = 3,
291         NFCHR = 4,
292         NFLNK = 5
293 };
294 .DE
295 .KE
296 The enumeration
297 .I ftype 
298 gives the type of a file.  The type 
299 .I NFNON 
300 indicates a non-file,
301 .I NFREG 
302 is a regular file, 
303 .I NFDIR 
304 is a directory,
305 .I NFBLK 
306 is a block-special device, 
307 .I NFCHR 
308 is a character-special device, and
309 .I NFLNK 
310 is a symbolic link.
311 .KS
312 .NH 3
313 \&fhandle
314 .IX "NFS data types" fhandle "" \fIfhandle\fP
315 .DS
316 typedef opaque fhandle[FHSIZE];
317 .DE
318 .KE
319 The
320 .I fhandle 
321 is the file handle passed between the server and the client.  
322 All file operations are done using file handles to refer to a file or 
323 directory.  The file handle can contain whatever information the server
324 needs to distinguish an individual file.
325 .KS
326 .NH 3
327 \&timeval
328 .IX "NFS data types" timeval "" \fItimeval\fP
329 .DS
330 struct timeval {
331         unsigned int seconds;
332         unsigned int useconds;
333 };
334 .DE
335 .KE
336 The 
337 .I timeval
338 structure is the number of seconds and microseconds 
339 since midnight January 1, 1970, Greenwich Mean Time.  It is used to 
340 pass time and date information.
341 .KS
342 .NH 3
343 \&fattr
344 .IX "NFS data types" fattr "" \fIfattr\fP
345 .DS
346 struct fattr {
347         ftype        type;
348         unsigned int mode;
349         unsigned int nlink;
350         unsigned int uid;
351         unsigned int gid;
352         unsigned int size;
353         unsigned int blocksize;
354         unsigned int rdev;
355         unsigned int blocks;
356         unsigned int fsid;
357         unsigned int fileid;
358         timeval      atime;
359         timeval      mtime;
360         timeval      ctime;
361 };
362 .DE
363 .KE
364 The
365 .I fattr 
366 structure contains the attributes of a file; "type" is the type of
367 the file; "nlink" is the number of hard links to the file (the number
368 of different names for the same file); "uid" is the user
369 identification number of the owner of the file; "gid" is the group
370 identification number of the group of the file; "size" is the size in
371 bytes of the file; "blocksize" is the size in bytes of a block of the
372 file; "rdev" is the device number of the file if it is type
373 .I NFCHR 
374 or
375 .I NFBLK ;
376 "blocks" is the number of blocks the file takes up on disk; "fsid" is
377 the file system identifier for the filesystem containing the file;
378 "fileid" is a number that uniquely identifies the file within its
379 filesystem; "atime" is the time when the file was last accessed for
380 either read or write; "mtime" is the time when the file data was last
381 modified (written); and "ctime" is the time when the status of the
382 file was last changed.  Writing to the file also changes "ctime" if
383 the size of the file changes.
384 .LP
385 "mode" is the access mode encoded as a set of bits.  Notice that the
386 file type is specified both in the mode bits and in the file type.
387 This is really a bug in the protocol and will be fixed in future
388 versions.  The descriptions given below specify the bit positions
389 using octal numbers.
390 .TS
391 box tab (&) ;
392 cfI cfI
393 lfL l .
394 Bit&Description
395 _
396 0040000&This is a directory; "type" field should be NFDIR.
397 0020000&This is a character special file; "type" field should be NFCHR. 
398 0060000&This is a block special file; "type" field should be NFBLK. 
399 0100000&This is a regular file; "type" field should be NFREG.
400 0120000&This is a symbolic link file;  "type" field should be NFLNK. 
401 0140000&This is a named socket; "type" field should be NFNON.
402 0004000&Set user id on execution.
403 0002000&Set group id on execution.
404 0001000&Save swapped text even after use.
405 0000400&Read permission for owner.
406 0000200&Write permission for owner.
407 0000100&Execute and search permission for owner.
408 0000040&Read permission for group.
409 0000020&Write permission for group.
410 0000010&Execute and search permission for group.
411 0000004&Read permission for others.
412 0000002&Write permission for others.
413 0000001&Execute and search permission for others.
414 .TE
415 .KS
416 Notes:
417 .IP 
418 The bits are  the same as the mode   bits returned  by  the
419 .I stat(2) 
420 system call in the UNIX system.  The file  type is  specified  both in
421 the mode  bits  and in  the file type.   This   is fixed  in future
422 versions.
423 .IP
424 The "rdev" field in the attributes structure is an operating system
425 specific device specifier.  It  will be  removed and generalized in
426 the next revision of the protocol.
427 .KE
428 .LP
429 .KS
430 .NH 3
431 \&sattr
432 .IX "NFS data types" sattr "" \fIsattr\fP
433 .DS
434 struct sattr {
435         unsigned int mode;
436         unsigned int uid;
437         unsigned int gid;
438         unsigned int size;
439         timeval      atime;
440         timeval      mtime;
441 };
442 .DE
443 .KE
444 The 
445 .I sattr
446 structure contains the file attributes which can be set
447 from the client.  The fields are the same as for  
448 .I fattr 
449 above.  A "size" of zero  means the file should be  truncated.
450 A value of -1 indicates a field that should be ignored.
451 .LP
452 .KS
453 .NH 3
454 \&filename
455 .IX "NFS data types" filename "" \fIfilename\fP
456 .DS
457 typedef string filename<MAXNAMLEN>;
458 .DE
459 .KE
460 The type
461 .I filename 
462 is used for  passing file names  or  pathname components.
463 .LP
464 .KS
465 .NH 3
466 \&path
467 .IX "NFS data types" path "" \fIpath\fP
468 .DS
469 typedef string path<MAXPATHLEN>;
470 .DE
471 .KE
472 The type
473 .I path 
474 is a pathname.  The server considers it as a string
475 with no internal structure,  but to the client  it is the name of a
476 node in a filesystem tree.
477 .LP
478 .KS
479 .NH 3
480 \&attrstat
481 .IX "NFS data types" attrstat "" \fIattrstat\fP
482 .DS
483 union attrstat switch (stat status) {
484         case NFS_OK:
485                 fattr attributes;
486         default:
487                 void;
488 };
489 .DE
490 .KE
491 The 
492 .I attrstat 
493 structure is a common procedure result.  It contains
494 a  "status" and,  if  the call   succeeded,   it also contains  the
495 attributes of the file on which the operation was done.
496 .LP
497 .KS
498 .NH 3
499 \&diropargs
500 .IX "NFS data types" diropargs "" \fIdiropargs\fP
501 .DS
502 struct diropargs {
503         fhandle  dir;
504         filename name;
505 };
506 .DE
507 .KE
508 The  
509 .I diropargs 
510 structure is used  in  directory  operations.  The
511 "fhandle" "dir" is the directory in  which to find the file "name".
512 A directory operation is one in which the directory is affected.
513 .LP
514 .KS
515 .NH 3
516 \&diropres
517 .IX "NFS data types" diropres "" \fIdiropres\fP
518 .DS
519 union diropres switch (stat status) {
520         case NFS_OK:
521                 struct {
522                         fhandle file;
523                         fattr   attributes;
524                 } diropok;
525         default:
526                 void;
527 };
528 .DE
529 .KE
530 The results of a directory operation  are returned  in a 
531 .I diropres 
532 structure.  If the call succeeded, a new file handle "file" and the
533 "attributes" associated with that file are  returned along with the
534 "status".
535 .NH 2
536 \&Server Procedures
537 .IX "NFS server procedures" "" "" "" PAGE MAJOR
538 .LP
539 The  protocol definition  is given as   a  set  of  procedures with
540 arguments  and results defined using the   RPC  language.   A brief
541 description of the function of each procedure should provide enough
542 information to allow implementation.
543 .LP
544 All of  the procedures  in   the NFS  protocol  are assumed  to  be
545 synchronous.   When a procedure  returns to the  client, the client
546 can assume that the operation has completed and any data associated
547 with the request is  now on stable storage.  For  example, a client
548 .I WRITE 
549 request   may  cause  the   server  to  update  data  blocks,
550 filesystem information blocks (such as indirect  blocks),  and file
551 attribute  information (size  and  modify  times).  When  the 
552 .I WRITE 
553 returns to the client, it can assume  that the write  is safe, even
554 in case of  a server  crash, and  it can discard the  data written.
555 This is a very important part  of the statelessness  of the server.
556 If the server waited to flush data from remote requests, the client
557 would have to  save those requests so that  it could resend them in
558 case of a server crash.
559 .ie t .DS
560 .el .DS L
561
562 .ft I
563 /*
564 * Remote file service routines
565 */
566 .ft CW
567 program NFS_PROGRAM {
568         version NFS_VERSION {
569                 void        NFSPROC_NULL(void)              = 0;
570                 attrstat    NFSPROC_GETATTR(fhandle)        = 1;
571                 attrstat    NFSPROC_SETATTR(sattrargs)      = 2;
572                 void        NFSPROC_ROOT(void)              = 3;
573                 diropres    NFSPROC_LOOKUP(diropargs)       = 4;
574                 readlinkres NFSPROC_READLINK(fhandle)       = 5;
575                 readres     NFSPROC_READ(readargs)          = 6;
576                 void        NFSPROC_WRITECACHE(void)        = 7;
577                 attrstat    NFSPROC_WRITE(writeargs)        = 8;
578                 diropres    NFSPROC_CREATE(createargs)      = 9;
579                 stat        NFSPROC_REMOVE(diropargs)       = 10;
580                 stat        NFSPROC_RENAME(renameargs)      = 11;
581                 stat        NFSPROC_LINK(linkargs)          = 12;
582                 stat        NFSPROC_SYMLINK(symlinkargs)    = 13;
583                 diropres    NFSPROC_MKDIR(createargs)       = 14;
584                 stat        NFSPROC_RMDIR(diropargs)        = 15;
585                 readdirres  NFSPROC_READDIR(readdirargs)    = 16;
586                 statfsres   NFSPROC_STATFS(fhandle)         = 17;
587         } = 2;
588 } = 100003;
589 .DE
590 .KS
591 .NH 3
592 \&Do Nothing
593 .IX "NFS server procedures" NFSPROC_NULL() "" \fINFSPROC_NULL()\fP
594 .DS
595 void 
596 NFSPROC_NULL(void) = 0;
597 .DE
598 .KE
599 This procedure does no work.   It is made available  in  all RPC
600 services to allow server response testing and timing.
601 .KS
602 .NH 3
603 \&Get File Attributes
604 .IX "NFS server procedures" NFSPROC_GETATTR() "" \fINFSPROC_GETATTR()\fP
605 .DS
606 attrstat 
607 NFSPROC_GETATTR (fhandle) = 1;
608 .DE
609 .KE
610 If the reply  status is 
611 .I NFS_OK ,
612 then  the reply attributes contains
613 the attributes for the file given by the input fhandle.
614 .KS
615 .NH 3
616 \&Set File Attributes
617 .IX "NFS server procedures" NFSPROC_SETATTR() "" \fINFSPROC_SETATTR()\fP
618 .DS
619 struct sattrargs {
620         fhandle file;
621         sattr attributes;
622         };
623
624 attrstat
625 NFSPROC_SETATTR (sattrargs) = 2;
626 .DE
627 .KE
628 The  "attributes" argument  contains fields which are either  -1 or
629 are  the  new value for  the  attributes of  "file".   If the reply
630 status is 
631 .I NFS_OK ,
632 then the  reply attributes have the attributes of
633 the file after the "SETATTR" operation has completed.
634 .LP
635 Note: The use of -1 to indicate an unused field in "attributes" is
636 changed in the next version of the protocol.
637 .KS
638 .NH 3
639 \&Get Filesystem Root
640 .IX "NFS server procedures" NFSPROC_ROOT "" \fINFSPROC_ROOT\fP
641 .DS
642 void 
643 NFSPROC_ROOT(void) = 3;
644 .DE
645 .KE
646 Obsolete.  This procedure  is no longer used   because  finding the
647 root file handle of a filesystem requires moving  pathnames between
648 client  and server.  To  do  this right we would  have  to define a
649 network standard representation of pathnames.  Instead, the
650 function  of  looking up  the   root  file handle  is  done  by the
651 .I MNTPROC_MNT() 
652 procedure.    (See the
653 .I "Mount Protocol Definition"
654 later in this chapter for details).
655 .KS
656 .NH 3
657 \&Look Up File Name
658 .IX "NFS server procedures" NFSPROC_LOOKUP() "" \fINFSPROC_LOOKUP()\fP
659 .DS
660 diropres
661 NFSPROC_LOOKUP(diropargs) = 4;
662 .DE
663 .KE
664 If  the reply "status"  is 
665 .I NFS_OK ,
666 then the reply  "file" and reply
667 "attributes" are the file handle and attributes for the file "name"
668 in the directory given by "dir" in the argument.
669 .KS
670 .NH 3
671 \&Read From Symbolic Link
672 .IX "NFS server procedures" NFSPROC_READLINK() "" \fINFSPROC_READLINK()\fP
673 .DS
674 union readlinkres switch (stat status) {
675         case NFS_OK:
676                 path data;
677         default:
678                 void;
679 };
680
681 readlinkres
682 NFSPROC_READLINK(fhandle) = 5;
683 .DE
684 .KE
685 If "status" has the value 
686 .I NFS_OK ,
687 then the reply "data" is the data in 
688 the symbolic link given by the file referred to by the fhandle argument.
689 .LP
690 Note:  since   NFS always  parses pathnames    on the  client, the
691 pathname in  a symbolic  link may  mean something  different (or be
692 meaningless) on a different client or on the server if  a different
693 pathname syntax is used.
694 .KS
695 .NH 3
696 \&Read From File
697 .IX "NFS server procedures" NFSPROC_READ "" \fINFSPROC_READ\fP
698 .DS
699 struct readargs {
700         fhandle file;
701         unsigned offset;
702         unsigned count;
703         unsigned totalcount;
704 };
705
706 union readres switch (stat status) {
707         case NFS_OK:
708                 fattr attributes;
709                 opaque data<NFS_MAXDATA>;
710         default:
711                 void;
712 };
713
714 readres
715 NFSPROC_READ(readargs) = 6;
716 .DE
717 .KE
718 Returns  up  to  "count" bytes of   "data" from  the file  given by
719 "file", starting at "offset" bytes from  the beginning of the file.
720 The first byte of the file is  at offset zero.  The file attributes
721 after the read takes place are returned in "attributes".
722 .LP
723 Note: The  argument "totalcount" is  unused, and is removed in the
724 next protocol revision.
725 .KS
726 .NH 3
727 \&Write to Cache
728 .IX "NFS server procedures" NFSPROC_WRITECACHE() "" \fINFSPROC_WRITECACHE()\fP
729 .DS
730 void
731 NFSPROC_WRITECACHE(void) = 7;
732 .DE
733 .KE
734 To be used in the next protocol revision.
735 .KS
736 .NH 3
737 \&Write to File
738 .IX "NFS server procedures" NFSPROC_WRITE() "" \fINFSPROC_WRITE()\fP
739 .DS
740 struct writeargs {
741         fhandle file;          
742         unsigned beginoffset;  
743         unsigned offset;       
744         unsigned totalcount;   
745         opaque data<NFS_MAXDATA>;
746 };
747
748 attrstat        
749 NFSPROC_WRITE(writeargs) = 8;
750 .DE
751 .KE
752 Writes   "data" beginning  "offset"  bytes  from the  beginning  of
753 "file".  The first byte  of  the file is at  offset  zero.  If  the
754 reply "status" is NFS_OK, then  the reply "attributes" contains the
755 attributes  of the file after the  write has  completed.  The write
756 operation is atomic.  Data from this  call to 
757 .I WRITE 
758 will not be mixed with data from another client's calls.
759 .LP
760 Note: The arguments "beginoffset" and "totalcount" are ignored and
761 are removed in the next protocol revision.
762 .KS
763 .NH 3
764 \&Create File
765 .IX "NFS server procedures" NFSPROC_CREATE() "" \fINFSPROC_CREATE()\fP
766 .DS
767 struct createargs {
768         diropargs where;
769         sattr attributes;
770 };
771
772 diropres
773 NFSPROC_CREATE(createargs) = 9;
774 .DE
775 .KE
776 The file "name" is created  in the directory given  by "dir".   The
777 initial  attributes of the  new file  are given by "attributes".  A
778 reply "status"  of NFS_OK indicates that the  file was created, and
779 reply "file"   and   reply "attributes"  are    its file handle and
780 attributes.   Any  other reply  "status"  means that  the operation
781 failed and no file was created.
782 .LP
783 Note: This  routine should pass  an exclusive create flag, meaning
784 "create the file only if it is not already there".
785 .KS
786 .NH 3
787 \&Remove File
788 .IX "NFS server procedures" NFSPROC_REMOVE() "" \fINFSPROC_REMOVE()\fP
789 .DS
790 stat
791 NFSPROC_REMOVE(diropargs) = 10;
792 .DE
793 .KE
794 The file "name" is  removed from the directory  given by "dir".   A
795 reply of NFS_OK means the directory entry was removed.
796 .LP
797 Note: possibly non-idempotent operation.
798 .KS
799 .NH 3
800 \&Rename File
801 .IX "NFS server procedures" NFSPROC_RENAME() "" \fINFSPROC_RENAME()\fP
802 .DS
803 struct renameargs {
804         diropargs from; 
805         diropargs to;
806 };
807
808 stat
809 NFSPROC_RENAME(renameargs) = 11;
810 .DE
811 .KE
812 The existing file "from.name" in  the directory given by "from.dir"
813 is renamed to "to.name" in the directory given by "to.dir".  If the
814 reply  is 
815 .I NFS_OK ,
816 the file was  renamed.  The  
817 RENAME  
818 operation is
819 atomic on the server; it cannot be interrupted in the middle.
820 .LP
821 Note: possibly non-idempotent operation.
822 .KS
823 .NH 3
824 \&Create Link to File
825 .IX "NFS server procedures" NFSPROC_LINK() "" \fINFSPROC_LINK()\fP
826 .DS
827 struct linkargs {
828         fhandle from;
829         diropargs to;
830 };
831
832 stat
833 NFSPROC_LINK(linkargs) = 12;
834 .DE
835 .KE
836 Creates the  file "to.name"  in the directory  given   by "to.dir",
837 which is a hard link to the existing file given  by "from".  If the
838 return value is 
839 .I NFS_OK ,
840 a link was created.  Any other return value
841 indicates an error, and the link was not created.
842 .LP
843 A hard link should have the property that changes  to either of the
844 linked files are reflected in both files.  When a hard link is made
845 to a  file, the attributes  for  the file should  have  a value for
846 "nlink" that is one greater than the value before the link.
847 .LP
848 Note: possibly non-idempotent operation.
849 .KS
850 .NH 3
851 \&Create Symbolic Link
852 .IX "NFS server procedures" NFSPROC_SYMLINK() "" \fINFSPROC_SYMLINK()\fP
853 .DS
854 struct symlinkargs {
855         diropargs from;
856         path to;
857         sattr attributes;
858 };
859
860 stat
861 NFSPROC_SYMLINK(symlinkargs) = 13;
862 .DE
863 .KE
864 Creates the  file "from.name" with  ftype  
865 .I NFLNK 
866 in  the  directory
867 given by "from.dir".   The new file contains  the pathname "to" and
868 has initial attributes given by "attributes".  If  the return value
869 is 
870 .I NFS_OK ,
871 a link was created.  Any other return value indicates an
872 error, and the link was not created.
873 .LP
874 A symbolic  link is  a pointer to another file.   The name given in
875 "to" is  not interpreted by  the server, only stored in  the  newly
876 created file.  When the client references a file that is a symbolic
877 link, the contents of the symbolic  link are normally transparently
878 reinterpreted  as a pathname  to substitute.   A 
879 .I READLINK 
880 operation returns the data to the client for interpretation.
881 .LP
882 Note:  On UNIX servers the attributes are never used, since
883 symbolic links always have mode 0777.
884 .KS
885 .NH 3
886 \&Create Directory
887 .IX "NFS server procedures" NFSPROC_MKDIR() "" \fINFSPROC_MKDIR()\fP
888 .DS
889 diropres
890 NFSPROC_MKDIR (createargs) = 14;
891 .DE
892 .KE
893 The new directory "where.name" is created in the directory given by
894 "where.dir".  The initial attributes of the new directory are given
895 by "attributes".  A reply "status" of NFS_OK indicates that the new
896 directory was created, and reply "file" and  reply "attributes" are
897 its file  handle and attributes.  Any  other  reply "status"  means
898 that the operation failed and no directory was created.
899 .LP
900 Note: possibly non-idempotent operation.
901 .KS
902 .NH 3
903 \&Remove Directory
904 .IX "NFS server procedures" NFSPROC_RMDIR() "" \fINFSPROC_RMDIR()\fP
905 .DS
906 stat
907 NFSPROC_RMDIR(diropargs) = 15;
908 .DE
909 .KE
910 The existing empty directory "name" in the directory given by "dir"
911 is removed.  If the reply is 
912 .I NFS_OK ,
913 the directory was removed.
914 .LP
915 Note: possibly non-idempotent operation.
916 .KS
917 .NH 3
918 \&Read From Directory
919 .IX "NFS server procedures" NFSPROC_READDIR() "" \fINFSPROC_READDIR()\fP
920 .DS
921 struct readdirargs {
922         fhandle dir;            
923         nfscookie cookie;
924         unsigned count;         
925 };
926
927 struct entry {
928         unsigned fileid;
929         filename name;
930         nfscookie cookie;
931         entry *nextentry;
932 };
933
934 union readdirres switch (stat status) {
935         case NFS_OK:
936                 struct {
937                         entry *entries;
938                         bool eof;
939                 } readdirok;
940         default:
941                 void;
942 };
943
944 readdirres
945 NFSPROC_READDIR (readdirargs) = 16;
946 .DE
947 .KE
948 Returns a variable number of  directory entries,  with a total size
949 of up to "count" bytes, from the directory given  by "dir".  If the
950 returned  value of "status"  is 
951 .I NFS_OK ,
952 then  it  is followed  by a
953 variable  number  of "entry"s.    Each "entry" contains  a "fileid"
954 which consists of a  unique number  to identify the  file within  a
955 filesystem,  the  "name" of the  file, and a "cookie" which   is an
956 opaque pointer to the next entry in  the  directory.  The cookie is
957 used  in the next  
958 .I READDIR 
959 call to get more  entries  starting at a
960 given point in  the directory.  The  special cookie zero (all  bits
961 zero) can be used to get the entries starting  at the  beginning of
962 the directory.  The "fileid" field should be the same number as the
963 "fileid" in the attributes of the file.  (See the
964 .I "Basic Data Types"
965 section.) 
966 The "eof" flag has a value of
967 .I TRUE 
968 if there are no more entries in the directory.
969 .KS
970 .NH 3
971 \&Get Filesystem Attributes
972 .IX "NFS server procedures" NFSPROC_STATFS() "" \fINFSPROC_STATFS()\fP
973 .DS
974 union statfsres (stat status) {
975         case NFS_OK:
976                 struct {
977                         unsigned tsize; 
978                         unsigned bsize; 
979                         unsigned blocks;
980                         unsigned bfree; 
981                         unsigned bavail;
982                 } info;
983         default:
984                 void;
985 };
986
987 statfsres
988 NFSPROC_STATFS(fhandle) = 17;
989 .DE
990 .KE
991 If the  reply "status"  is 
992 .I NFS_OK ,
993 then the  reply "info" gives the
994 attributes for the filesystem that contains file referred to by the
995 input fhandle.  The attribute fields contain the following values:
996 .IP tsize:   
997 The optimum transfer size of the server in bytes.  This is
998 the number  of bytes the server  would like to have in the
999 data part of READ and WRITE requests.
1000 .IP bsize:   
1001 The block size in bytes of the filesystem.
1002 .IP blocks:  
1003 The total number of "bsize" blocks on the filesystem.
1004 .IP bfree:   
1005 The number of free "bsize" blocks on the filesystem.
1006 .IP bavail:  
1007 The number of  "bsize" blocks  available to non-privileged users.
1008 .LP
1009 Note: This call does not  work well if a  filesystem has  variable
1010 size blocks.
1011 .NH 1
1012 \&NFS Implementation Issues
1013 .IX NFS implementation
1014 .LP
1015 The NFS protocol is designed to be operating system independent, but
1016 since this version was designed in a UNIX environment, many
1017 operations have semantics similar to the operations of the UNIX file
1018 system.  This section discusses some of the implementation-specific
1019 semantic issues.
1020 .NH 2
1021 \&Server/Client Relationship
1022 .IX NFS "server/client relationship"
1023 .LP
1024 The NFS protocol is designed to allow servers to be as simple and
1025 general as possible.  Sometimes the simplicity of the server can be a
1026 problem, if the client wants to implement complicated filesystem
1027 semantics.
1028 .LP
1029 For example, some operating systems allow removal of open files.  A
1030 process can open a file and, while it is open, remove it from the
1031 directory.  The file can be read and written as long as the process
1032 keeps it open, even though the file has no name in the filesystem.
1033 It is impossible for a stateless server to implement these semantics.
1034 The client can do some tricks such as renaming the file on remove,
1035 and only removing it on close.  We believe that the server provides
1036 enough functionality to implement most file system semantics on the
1037 client.
1038 .LP
1039 Every NFS client can also potentially be a server, and remote and
1040 local mounted filesystems can be freely intermixed.  This leads to
1041 some interesting problems when a client travels down the directory
1042 tree of a remote filesystem and reaches the mount point on the server
1043 for another remote filesystem.  Allowing the server to follow the
1044 second remote mount would require loop detection, server lookup, and
1045 user revalidation.  Instead, we decided not to let clients cross a
1046 server's mount point.  When a client does a LOOKUP on a directory on
1047 which the server has mounted a filesystem, the client sees the
1048 underlying directory instead of the mounted directory.  A client can
1049 do remote mounts that match the server's mount points to maintain the
1050 server's view.
1051 .LP
1052 .NH 2
1053 \&Pathname Interpretation
1054 .IX NFS "pathname interpretation"
1055 .LP
1056 There are a few complications to the rule that pathnames are always
1057 parsed on the client.  For example, symbolic links could have
1058 different interpretations on different clients.  Another common
1059 problem for non-UNIX implementations is the special interpretation of
1060 the pathname ".."  to mean the parent of a given directory.  The next
1061 revision of the protocol uses an explicit flag to indicate the parent
1062 instead.
1063 .NH 2
1064 \&Permission Issues
1065 .IX NFS "permission issues"
1066 .LP
1067 The NFS protocol, strictly speaking, does not define the permission
1068 checking used  by servers.  However,  it is  expected that a server
1069 will do normal operating system permission checking using 
1070 .I AUTH_UNIX 
1071 style authentication as the basis of its protection mechanism.  The
1072 server gets the client's effective "uid", effective "gid", and groups
1073 on each call and uses them to check permission.  There are various
1074 problems with this method that can been resolved in interesting ways.
1075 .LP
1076 Using "uid" and "gid" implies that the client and server share the
1077 same "uid" list.  Every server and client pair must have the same
1078 mapping from user to "uid" and from group to "gid".  Since every
1079 client can also be a server, this tends to imply that the whole
1080 network shares the same "uid/gid" space.
1081 .I AUTH_DES 
1082 (and the  next
1083 revision of the NFS protocol) uses string names instead of numbers,
1084 but there are still complex problems to be solved.
1085 .LP
1086 Another problem arises due to the usually stateful open operation.
1087 Most operating systems check permission at open time, and then check
1088 that the file is open on each read and write request.  With stateless
1089 servers, the server has no idea that the file is open and must do
1090 permission checking on each read and write call.  On a local
1091 filesystem, a user can open a file and then change the permissions so
1092 that no one is allowed to touch it, but will still be able to write
1093 to the file because it is open.  On a remote filesystem, by contrast,
1094 the write would fail.  To get around this problem, the server's
1095 permission checking algorithm should allow the owner of a file to
1096 access it regardless of the permission setting.
1097 .LP
1098 A similar problem has to do with paging in from a file over the
1099 network.  The operating system usually checks for execute permission
1100 before opening a file for demand paging, and then reads blocks from
1101 the open file.  The file may not have read permission, but after it
1102 is opened it doesn't matter.  An NFS server can not tell the
1103 difference between a normal file read and a demand page-in read.  To
1104 make this work, the server allows reading of files if the "uid" given
1105 in the call has execute or read permission on the file.
1106 .LP
1107 In most operating systems, a particular user (on the user ID zero)
1108 has access to all files no matter what permission and ownership they
1109 have.  This "super-user" permission may not be allowed on the server,
1110 since anyone who can become super-user on their workstation could
1111 gain access to all remote files.  The UNIX server by default maps
1112 user id 0 to -2 before doing its access checking.  This works except
1113 for NFS root filesystems, where super-user access cannot be avoided.
1114 .NH 2
1115 \&Setting RPC Parameters
1116 .IX NFS "setting RPC parameters"
1117 .LP
1118 Various file system parameters and options should be set at mount
1119 time.  The mount protocol is described in the appendix below.  For
1120 example, "Soft" mounts as well as "Hard" mounts are usually both
1121 provided.  Soft mounted file systems return errors when RPC
1122 operations fail (after a given number of optional retransmissions),
1123 while hard mounted file systems continue to retransmit forever.
1124 Clients and servers may need to keep caches of recent operations to
1125 help avoid problems with non-idempotent operations.
1126 .NH 1
1127 \&Mount Protocol Definition
1128 .IX "mount protocol" "" "" "" PAGE MAJOR
1129 .sp 1
1130 .NH 2
1131 \&Introduction
1132 .IX "mount protocol" introduction
1133 .LP
1134 The mount protocol is separate from, but related to, the NFS
1135 protocol.  It provides operating system specific services to get the
1136 NFS off the ground -- looking up server path names, validating user
1137 identity, and checking access permissions.  Clients use the mount
1138 protocol to get the first file handle, which allows them entry into a
1139 remote filesystem.
1140 .LP
1141 The mount protocol is kept separate from the NFS protocol to make it
1142 easy to plug in new access checking and validation methods without
1143 changing the NFS server protocol.
1144 .LP
1145 Notice that the protocol definition implies stateful servers because
1146 the server maintains a list of client's mount requests.  The mount
1147 list information is not critical for the correct functioning of
1148 either the client or the server.  It is intended for advisory use
1149 only, for example, to warn possible clients when a server is going
1150 down.
1151 .LP
1152 Version one of the mount protocol is used with version two of the NFS
1153 protocol.  The only connecting point is the
1154 .I fhandle 
1155 structure, which is the same for both protocols.
1156 .NH 2
1157 \&RPC Information
1158 .IX "mount protocol"  "RPC information"
1159 .IP \fIAuthentication\fP
1160 The mount service uses 
1161 .I AUTH_UNIX 
1162 and 
1163 .I AUTH_DES 
1164 style authentication only.
1165 .IP "\fITransport Protocols\fP"
1166 The mount service is currently supported on UDP/IP only.
1167 .IP "\fIPort Number\fP"
1168 Consult the server's portmapper, described in the chapter
1169 .I "Remote Procedure Calls: Protocol Specification",
1170 to  find  the  port number on which the mount service is registered.
1171 .NH 2
1172 \&Sizes of XDR Structures
1173 .IX "mount protocol" "XDR structure sizes"
1174 .LP
1175 These  are  the sizes,   given  in  decimal   bytes, of various XDR
1176 structures used in the protocol:
1177 .DS
1178 /* \fIThe maximum number of bytes in a pathname argument\fP */
1179 const MNTPATHLEN = 1024;
1180
1181 /* \fIThe maximum number of bytes in a name argument\fP */
1182 const MNTNAMLEN = 255;
1183
1184 /* \fIThe size in bytes of the opaque file handle\fP */
1185 const FHSIZE = 32;
1186 .DE
1187 .NH 2
1188 \&Basic Data Types
1189 .IX "mount protocol" "basic data types"
1190 .IX "mount data types"
1191 .LP
1192 This section presents the data  types used by  the  mount protocol.
1193 In many cases they are similar to the types used in NFS.
1194 .KS
1195 .NH 3
1196 \&fhandle
1197 .IX "mount data types" fhandle "" \fIfhandle\fP
1198 .DS
1199 typedef opaque fhandle[FHSIZE];
1200 .DE
1201 .KE
1202 The type 
1203 .I fhandle 
1204 is the file handle that the server passes to the
1205 client.  All file operations are done  using file handles  to refer
1206 to a  file  or directory.   The  file handle  can  contain whatever
1207 information the server needs to distinguish an individual file.
1208 .LP
1209 This  is the  same as the "fhandle" XDR definition in version 2 of
1210 the NFS protocol;  see 
1211 .I "Basic Data Types"
1212 in the definition of the NFS protocol, above.
1213 .KS
1214 .NH 3
1215 \&fhstatus
1216 .IX "mount data types" fhstatus "" \fIfhstatus\fP
1217 .DS
1218 union fhstatus switch (unsigned status) {
1219         case 0:
1220                 fhandle directory;
1221         default:
1222                 void;
1223 };
1224 .DE
1225 .KE
1226 The type 
1227 .I fhstatus 
1228 is a union.  If a "status" of zero is returned,
1229 the  call completed   successfully, and  a  file handle   for   the
1230 "directory"  follows.  A  non-zero  status indicates  some  sort of
1231 error.  In this case the status is a UNIX error number.
1232 .KS
1233 .NH 3
1234 \&dirpath
1235 .IX "mount data types" dirpath "" \fIdirpath\fP
1236 .DS
1237 typedef string dirpath<MNTPATHLEN>;
1238 .DE
1239 .KE
1240 The type 
1241 .I dirpath 
1242 is a server pathname of a directory.
1243 .KS
1244 .NH 3
1245 \&name
1246 .IX "mount data types" name "" \fIname\fP
1247 .DS
1248 typedef string name<MNTNAMLEN>;
1249 .DE
1250 .KE
1251 The type 
1252 .I name 
1253 is an arbitrary string used for various names.
1254 .NH 2
1255 \&Server Procedures
1256 .IX "mount server procedures"
1257 .LP
1258 The following sections define the RPC procedures  supplied by a
1259 mount server.
1260 .ie t .DS
1261 .el .DS L
1262 .ft I
1263 /*
1264 * Protocol description for the mount program
1265 */
1266 .ft CW
1267
1268 program MOUNTPROG {
1269 .ft I
1270 /*
1271 * Version 1 of the mount protocol used with
1272 * version 2 of the NFS protocol.
1273 */
1274 .ft CW
1275         version MOUNTVERS {
1276                 void        MOUNTPROC_NULL(void)    = 0;
1277                 fhstatus    MOUNTPROC_MNT(dirpath)  = 1;
1278                 mountlist   MOUNTPROC_DUMP(void)    = 2;
1279                 void        MOUNTPROC_UMNT(dirpath) = 3;
1280                 void        MOUNTPROC_UMNTALL(void) = 4;
1281                 exportlist  MOUNTPROC_EXPORT(void)  = 5;
1282         } = 1;
1283 } = 100005;
1284 .DE
1285 .KS
1286 .NH 3
1287 \&Do Nothing
1288 .IX "mount server procedures" MNTPROC_NULL() "" \fIMNTPROC_NULL()\fP
1289 .DS
1290 void 
1291 MNTPROC_NULL(void) = 0;
1292 .DE
1293 .KE
1294 This  procedure does no work.  It   is  made  available in all  RPC
1295 services to allow server response testing and timing.
1296 .KS
1297 .NH 3
1298 \&Add Mount Entry
1299 .IX "mount server procedures" MNTPROC_MNT() "" \fIMNTPROC_MNT()\fP
1300 .DS
1301 fhstatus
1302 MNTPROC_MNT(dirpath) = 1;
1303 .DE
1304 .KE
1305 If the reply "status" is 0, then the reply "directory" contains the
1306 file handle for the directory "dirname".  This file handle may be
1307 used in the NFS protocol.  This procedure also adds a new entry to
1308 the mount list for this client mounting "dirname".
1309 .KS
1310 .NH 3
1311 \&Return Mount Entries
1312 .IX "mount server procedures" MNTPROC_DUMP() "" \fIMNTPROC_DUMP()\fP
1313 .DS
1314 struct *mountlist {
1315         name      hostname;
1316         dirpath   directory;
1317         mountlist nextentry;
1318 };
1319
1320 mountlist
1321 MNTPROC_DUMP(void) = 2;
1322 .DE
1323 .KE
1324 Returns  the list of  remote mounted filesystems.   The "mountlist"
1325 contains one entry for each "hostname" and "directory" pair.
1326 .KS
1327 .NH 3
1328 \&Remove Mount Entry
1329 .IX "mount server procedures" MNTPROC_UMNT() "" \fIMNTPROC_UMNT()\fP
1330 .DS
1331 void
1332 MNTPROC_UMNT(dirpath) = 3;
1333 .DE
1334 .KE
1335 Removes the mount list entry for the input "dirpath".
1336 .KS
1337 .NH 3
1338 \&Remove All Mount Entries
1339 .IX "mount server procedures" MNTPROC_UMNTALL() "" \fIMNTPROC_UMNTALL()\fP
1340 .DS
1341 void
1342 MNTPROC_UMNTALL(void) = 4;
1343 .DE
1344 .KE
1345 Removes all of the mount list entries for this client.
1346 .KS
1347 .NH 3
1348 \&Return Export List
1349 .IX "mount server procedures" MNTPROC_EXPORT() "" \fIMNTPROC_EXPORT()\fP
1350 .DS
1351 struct *groups {
1352         name grname;
1353         groups grnext;
1354 };
1355
1356 struct *exportlist {
1357         dirpath filesys;
1358         groups groups;
1359         exportlist next;
1360 };
1361
1362 exportlist
1363 MNTPROC_EXPORT(void) = 5;
1364 .DE
1365 .KE
1366 Returns a variable number of export list entries.  Each entry
1367 contains a filesystem name and a list of groups that are allowed to
1368 import it.  The filesystem name is in "filesys", and the group name
1369 is in the list "groups".
1370 .LP
1371 Note:  The exportlist should contain
1372 more information about the status of the filesystem, such as a
1373 read-only flag.