mount(2sv)mount(2sv)NAME
mount, umount - Mounts or unmounts a file system using the System V
function
SYNOPSIS
#include <sys/types.h> #include <sys/mount.h>
int mount(
char *spec,
char *dir,
int mflag,
int fstyp,
char *dataptr,
int datalen ); int umount (const
char *mnt-path);
PARAMETERS
Points to a path name that is a removable file system contained on the
block special file. Points to a path name that is the directory on
which spec is mounted. Specifies whether additional file system data
is included. The valid flag is MS_DATA. Specifies the file system
type number. Points to the address of a block of file system specific
data. Specifies the length of the file system specific data. Points
to a null-terminated string containing the appropriate pathname.
DESCRIPTION
The mount() function mounts a removable file system contained on the
block special file identified by spec. The dir argument identifies the
mount point.
When the MS_DATA flag bit of mflag is off, the file system type
defaults to the root file system type. Only when the MS_DATA flag bit
is on, should you use the fstyp argument to indicate the file system
type. Also, the dataptr and datalen arguments, which describe a block
of file system specific data, must be present when the MS_DATA flag is
set. The file system specific code within the operating system inter‐
prets the data. The data's format depends on the file system type. If a
file system type does not require this data, dataptr and datalen should
both be zero.
Use the low-order bit of mflag to control write permission on the
mounted file system. If the low-order bit is 1, writing is forbidden;
otherwise, writing is permitted according to individual file accessi‐
bility.
After a successful mount(), references to the dir file refer to the
mounted file system's root directory.
The umount() function unmounts a file system mounted at the directory
pointed to the mnt-path parameter. The associated directory reverts to
its ordinary interpretation.
Except for file-on-file mounting, to call either the mount() and
umount() function, the calling process must have superuser privilege.
NOTES
Two mount() functions are supported by Tru64 UNIX: the BSD mount() and
the System V mount(). The BSD function is the default mount() and it
is documented in mount(2). To use the System V version of mount(), doc‐
umented here you must link with the libsys5 library before you link
with the libc library or be in the System V habitat.
RESTRICTIONS
The mount command supports mount point argument pathnames of up to
MNAMELEN, which includes the null terminating character. MNAMELEN can
be up to 90 characters long, including the null terminating character.
RETURN VALUES
The mount() function returns 0 when the file system is successfully
mounted. Otherwise, -1 is returned and errno is set to indicate the
error.
ERRORS
If the mount() function fails, errno may be set to one of the following
values: The effective user ID is not super-user. Any of the named
files does not exist. A component of a path prefix is not a directory.
The file system identified by spec is remote and cannot be mounted.
The path argument points to a remote machine and the link to that
machine is no longer active. Components of path require hopping to
multiple remote machines. The spec argument is not a block special
device. The device associated with spec does not exist. The dir argu‐
ment is not a directory. The spec or dir argument points outside the
allocated address space of the process. The dir argument is a user's
current working directory, is mounted on a user's current working
directory, or is otherwise busy. The device associated with spec is
currently mounted. There are no more mount table entries. The spec is
write protected and mflag requests write permission. The file system
state in the super-block is not FsOKAY and mflag requests write permis‐
sion. The super block has an invalid magic number or the fstyp is
invalid or mflag is not valid.
If the umount() function fails, errno may be set to one of the follow‐
ing values: The caller does not have appropriate privilege. A compo‐
nent of the path is not a directory. The pathname contains a character
with the high-order bit set. A component of a pathname exceeded
NAME_MAX characters, or an entire pathname exceeded PATH_MAX charac‐
ters. Too many symbolic links were encountered in translating the
pathname. The requested directory is not in the mount table. A
process is holding a reference to a file located on the file system.
An I/O error occurred while writing cached file system information.
The mnt-path parameter points outside the process' allocated address
space. The device identified by the mnt-path does not exist. The
named file does not exist.
FILESSEE ALSO
Command: mount(8)
Function: statfs(2)mount(2sv)