exportfs(2nfs)exportfs(2nfs)Nameexportfs - exports an NFS file system
Syntax
#include <sys/mount.h>
exportfs(name, rootuid, exflags)
char *name;
int rootuid, exflags;
Description
The system call allows the specified local file system to be mounted
remotely by an NFS client. This system call is usually called from
Security on the exported file systems can be improved by setting the
root mapped user ID, rootuid, and two mount structure flags, exflags
for the local file system, name.
The name argument is a pointer to a null-terminated string containing
the path name of the file system being exported.
The rootuid argument is used to set the user ID that root maps to. By
default, root maps to user id -2.
The exflags argument contains the flags that are to be set in the mount
structure corresponding to name. The following flags are the only pos‐
sible flags accepted by
#define M_NOFH 0x1000 /* no fhandle flag */
#define M_EXRONLY 0x2000 /* export read-only */
Setting the M_NOFH flag does not allow access to the fhandle of the
file system's root gnode. The M_EXRONLY flag exports a filesystem read
only.
The system call returns a value of 0 upon successful completion of a
operation, and -1 upon failure.
Diagnostics
[EPERM] Not superuser.
[EIO] Not enough memory in the system to service the request.
[EFAULT] Bad address or bad length of name.
[ENOENT] The name cannot be found.
See Alsoexports(5nfs), mountd(8nfs)exportfs(2nfs)