mount, umount - Mounts or unmounts a file system using the System V function
#include <sys/types.h> #include <sys/mount.h>
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
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
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 interprets 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 accessibility.
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
function, the calling process
must have superuser privilege.
functions are supported by Tru64 UNIX:
and the System V
The BSD function is the default
and it is documented
mount(2). To use the System V version of
documented here you must link with the
before you link with the
library or be in the System
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.
when the file system is successfully mounted. Otherwise,
is returned and
is set to indicate the
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 argument 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 permission. The super block has an invalid magic number or the fstyp is invalid or mflag is not valid.
may be set to one of the following values:
The caller does not have appropriate privilege.
A component of the path is not a directory.
The pathname contains a character with the high-order bit
A component of a pathname exceeded NAME_MAX characters, or
an entire pathname exceeded PATH_MAX characters.
Too many symbolic links were encountered in translating the
The requested directory is not in the mount table.
A process is holding a reference to a file located on the
An I/O error occurred while writing cached file system information.
parameter points outside
the process' allocated address space.
The device identified by the
does not exist.
The named file does not exist.