mount(2sv) — System Calls
Digital
NAME
mount − mount a file system using the SVID-2 function
SYNOPSIS
#include <sys/types.h>
#include <sys/mount.h>
int mount (
char ∗spec,
char ∗dir,
int mflag,
int fstyp,
char ∗dataptr,
int datalen);
PARAMETERS
specPoints to a path name that is a removable file system contained on the block special file.
dirPoints to a path name that is the directory on which spec is mounted.
mflagSpecifies whether additional file system data is included. The valid flag is MS_DATA.
fstypSpecifies the file system type number.
dataptrPoints to the address of a block of file system specific data.
datalenSpecifies the length of the file system specific data.
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 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.
Only super-user can invoke the mount function. Its intended purpose is to be used by the mount(8) utility.
NOTES
Two mount() functions are supported by OSF/1: the BSD mount() and the SVID-2 mount(). The BSD function is the default mount() and it is documented in mount(2). To use the SVID-2 version of mount(), which is documented on this reference page, you must link with the libsys5 library before you link with libc.
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.
If the mount functions fails, errno is set to one of the following values:
[EPERM]The effective user ID is not super-user.
[ENOENT]Any of the named files does not exist.
[ENOTDIR]:A component of a path prefix is not a directory.
[EREMOTE]The file system identified by spec is remote and cannot be mounted.
[ENOLINK]The path argument points to a remote machine and the link to that machine is no longer active.
[EMULTIHOP]
Components of path require hopping to multiple remote machines.
[ENOTBLK]The spec argument is not a block special device.
[ENXIO]The device associated with spec does not exist.
[ENOTDIR]The dir argument is not a directory.
[EFAULT]The spec or dir argument points outside the allocated address space of the process.
[EBUSY]The dir argument is a user’s current working directory, is mounted on a user’s current working directory, or is otherwise busy.
[EBUSY]The device associated with spec is currently mounted.
[EBUSY]There are no more mount table entries.
[EROFS]The spec is write protected and mflag requests write permission.
[ENOSPC]The file system state in the super-block is not FsOKAY and mflag requests write permission.
[EINVAL]The super block has an invalid magic number or the fstyp is invalid or mflag is not valid.
RELATED INFORMATION
Command: mount(8).
Function: statfs(2).
System V Compatibility User’s Guide