mount - mount a file system
#include <fnctl.h>
#include <sys/mount.h>
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.
Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
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:
The mflag parameter is, currently, ignored by the FATFS implementation.