mount(2nfs)mount(2nfs)Name
mount, umount - mount or remove an NFS file system
Syntax
#include <sys/types.h>
#include <sys/fs_types.h>
mount(special, name, rwflag, type, options)
char *special, *name;
int rwflag, type;
char *options;
umount(dev)
dev_t dev;
Description
The system call announces to the system that a remote NFS file system
has been mounted on directory name. References to file name refer to
the root file on the newly mounted file system.
The special argument is a pointer to a null-terminated string contain‐
ing the pathname of the file system being mounted. It is of the form:
host:pathname
The name argument is a pointer to a null-terminated string containing
the pathname of the root file on the newly mounted file system. The
name must already exist and must be a directory. Its old contents are
inaccessible while the file system is mounted.
The rwflag argument is used to determine whether the file system can be
written to; if it is 0, the file system is writable, if nonzero, the
file system is write-protected.
The type argument identifies the file system type that is being
mounted. The DEFINE statement for the nfs type is:
#define GT_NFS 0x04
The nfs file system type is defined in the <fs_types.h> file.
The options argument specifies certain parameters that can be used to
define how the file system is to be mounted. The description lists the
available NFS options.
The following structure is used by the user-level routine as the fifth
argument when making a system call.
struct nfs_gfs_mount {
struct sockaddr_in addr; /* File server address /*
fhandle_t fh; /* File handle to be mounted /*
int flags; /* Flags handler /*
int wsize; /* Write size in bytes /*
int rsize; /* Read size in bytes /*
int timeo; /* Initial timeout in .1 secs. /*
int retrans; /* Times to retry send /*
char *hostname; /* Server's host name /*
char *optstr; /* Options string /*
int gfs_flags; /* GFS flags /*
int pg_thresh; /* Page threshold for exec /*
};
Return Values
The system call returns a value of 0 upon successful completion of a
operation, -1 if the operation fails.
The system call announces to the system that the remote file system
mounted on directory name is no longer available. The directory name
reverts to its ordinary interpretation.
The system call returns 0 if the dismount operation succeeds, -1 if it
fails.
Diagnostics
The call fails under the following conditions:
[EPERM] The caller is not the superuser and is not the owner of
the mount point.
[ENODEV] A component of special does not exist.
[EINVAL] The pathname contains a character with the high-order
bit set.
[ENOTDIR] A component of name is not a directory.
[EBUSY] Another process currently holds a reference to name.
[ENAMETOOLONG] A component of the pathname exceeded 255 characters, or
the entire length of the pathname exceeded 1023 charac‐
ters.
[ELOOP] Too many symbolic links were encountered in translating
the pathname.
[ENOENT] A component of name does not exist.
[EMFILE] No space remains in the mount table.
[EFAULT] The special or name points outside the process's allo‐
cated address space space.
[ESTALE] The fhandle given in the argument was invalid. The file
referred to by that file handle no longer exists or has
been revoked.
The call fails under the following conditions:
[EPERM] The caller is not the superuser and is not the owner of
the mount point.
[EINVAL] The requested mounted-on directory is not in the mount
table.
[EBUSY] A process is holding a reference to a file located on
the file system.
[EIO] An I/O error occurred while writing cached file system
information.
See Alsomount(2), gfsi(5), mount(8nfs)mount(2nfs)