NAME
mount - Mounts a file system
LIBRARY
System V Compatibility Library (libsys5.a)
SYNOPSIS
#include <sys/types.h>
#include <sys/mount.h>
int mount(
const char *fs,
const char *path,
int *mflag,
const char *fstype,
const char *dataptr,
int *datalen);
PARAMETERS
fs Specifies the pathname of the file system to be
mounted.
path Specifies the pathname upon which the file system
is to be mounted.
mflag Specifies a bit-mask of flag values. These include
the following, which are defined in <sys/mount.h>:
MS_DATA Specifies that the following parameters
are set to indicate file system-specific
data: fstype, dataptr, datalen. This
flag is used for backward compatibility
with previous System V releases.
In most cases, the MS_DATA flag is
required. However, if it is not set for
backward compatibility purposes, the
following is assumed: the fstype is the
root file system, and both the datptr
and datalen parameters are set to 0.
MS_NOSUID Specifies that the setuid or setgid bits
on files should not be honored when exe-
cuting those files.
MS_RDONLY Specifies that the file system should be
treated as read-only; no writing is
allowed (even by a process with
appropriate privilege). If this flag is
not set, write access is granted accord-
ing to the permission settings of
individual files. Physically write-
protected and magnetic tape file systems
must be mounted read-only or errors will
occur when access times are updated,
whether or not any explicit write is
attempted.
Note that you can turn on the MS_RDONLY
flag only when mounting a file system
that is not currently mounted. This
means that you cannot turn on the
MS_RDONLY flag when attempting to apply
the mount command to an already mounted
file system (with the MS_REMOUNT flag).
However, for some file systems you may
be able to turn off the MS_RDONLY flag
when using the MS_REMOUNT flag. See the
MS_REMOUNT flag for more information.
MS_REMOUNT
Specifies that the mount command is
being applied to an already mounted file
system. This allows the mount flags to
be changed to those specified by the
parameters in the call without requiring
that the file system be unmounted and
remounted. For example, if the MS_RDONLY
flag has been set for an already mounted
file system, you may use MS_REMOUNT to
turn off MS_RDONLY. Note that for some
file systems, you may not be able to
perform this operation.
fstype Specifies the file system type name.
dataptr Specifies the address of a block of data that is
specific to the file system. This parameter is
used together with the datalen parameter to
describe a block of data that is specific to the
file system. The format of both of these parame-
ters depends upon the file system type specified
by the fstype parameter, and they are interpreted
by the operating system code accordingly.
The file system being used by your system may not
require that dataptr parameter be used. If this is
the case, the dataptr parameter, should be set to
0.
datalen Specifies the length of a block of data that is
specific to the file system. This parameter is
used together with the dataptr parameter to
describe a block of data that is specific to the
file system. The format of both of these parame-
ters depends upon the file system type specified
by the fstype parameter, and they are interpreted
by the operating system code accordingly.
The file system being used by your system may not
require that datalen parameter be used. If this is
the case, the datalen parameter, should be set to
0.
DESCRIPTION
The mount() function mounts the file system specified by the
fs parameter on the file specified by the path parameter.
The fstype parameter specifies the file system type to be
mounted. Note that the mounting of some file system types
may require appropriate privileges. The mflag parameter
specifies a bit-mask of flag values and the dataptr and
datalen specify a block of data that is specific to the file
system. For more information on these parameters, see the
``PARAMETERS'' section.
If the mount() function completes successfully, references
to the file specified by the path parameter, will refer to
the mounted file system's root directory.
RETURN VALUE
Upon successful completion, the mount() function returns a 0
value. Otherwise, a value of -1 is returned and sets errno
to specify the error.
ERRORS
If the mount() function fails, errno may be set to one of
the following values:
[EBUSY] One of the following conditions is true about the
directory specified by the path parameter:
o It is a user's home directory.
o It is already mounted.
o It is busy.
[EBUSY] The file system specified by the fs parameter is
already mounted.
[EBUSY] The resources that are necessary for the requested
mount operation cannot be allocated.
[EINVAL] A sanity check failed or an argument to the system
call is not valid.
[ELOOP] When path was translated, too many symbolic links
were found.
ENAMETOOLONG
The size of a pathname component is longer than
{NAME_MAX} when {_POSIX_NO_TRUNC} is in effect, or
the pathname length is longer than {PATH_MAX}.
[ENOENT] The pathname of a specified file does not exist.
[ENOSPC] The file system specified by the fs parameter is
corrupted in some way and the mflag parameter has
requested write permission. Corruption might be a
result of a system crash and the fsck may need to
be run to clean up the problem.
[ENOTBLK] The file system type specified by the fstype
parameter requires that the file system be a block
special device. However, the file system specified
by the fs parameter is not a block special device.
[ENOTDIR] The directory portion of the path parameter does
not exist. However, the file system type speci-
fied by the fstype parameter requires that it
should exist.
[ENXIO] The device specified as part of the file system
name (the fs parameter) does not exist. However,
the file system type specified by the fstype
parameter requires that it should exist.
[EPERM] The process that called the mount() function does
not have the appropriate permission required by
the file system type (fstype).
[EROFS] The mflag parameter has requested write permis-
sion, but the file system specified by the fs
parameter is write protected.
RELATED INFORMATION
Function: umount(3)
In addition, AT&T also specifies a support level (Level 1).
Do we wish to specify a support level?
Acknowledgement and Disclaimer