NAME

mount - mount a file system

SYNOPSIS

#include <fnctl.h>
#include <sys/mount.h>

int mount(const char *spec ,
const char *dir ,
int mflag );
int umount(const char *dir);

DESCRIPTION

The mount() function requests that a removable file system contained on the block special file identified by spec be mounted on the directory identified by dir. The spec and dir arguments are pointers to path names.

The umount() function unmounts the file system mounted at dir.

The mflag flag is used to control write permission on the mounted file system: If set to FS_RDONLY, writing is forbidden; otherwise writing is permitted according to individual file accessibility. After a successful call to mount(), all references to the file dir refer to the root directory on the mounted file system.

RETURN VALUES

Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.

ERRORS

This function is a member of Unison's IOLIB family of functions. IOLIB is implemented as a message passing and generalized interface layer. Each Unison I/O server is responsible for its own error reporting.

For an exact list of error codes returned by a particular server, refer to that server's documentation in the Unison Programmer's Guide for each specific platform.

Servers may implement these errors codes in response to this function.

mount() fails if one or more of the following are true:

EBUSY
dir is currently mounted or is otherwise busy. Or, the device associated with spec is currently mounted. Or, there are no more mount table entries.
EFAULT
spec, dir, or datalen points outside the allocated address space of the process.
EINVAL
The super block has an invalid magic number or the fstyp is invalid.
EMULTIHOP
Components of path require hopping to multiple remote machines and the file system type does not allow it.
ENAMETOOLONG
The length of an argument is too large.
ENOENT
One of the named arguments does not exist or is a null pathname.
EREMOTE
spec is remote and cannot be mounted.
ENOLINK
path points to a remote machine and the link to that machine is no longer active.
ENXIO
The device associated with spec does not exist.
EROFS
spec is write protected and mflag requests write permission.
ENOSPC
The file system state in the super-block is not

SEE ALSO


NOTES

The mflag parameter is, currently, ignored by the FATFS implementation.


< Copyright Rowebots Research Inc. and Multiprocessor Toolsmiths Inc. 1987-2011 >