4.4BSD/usr/share/man/cat2/mount.0

Compare this file to the similar file:
Show the results in this format:

MOUNT(2)                    BSD Programmer's Manual                   MOUNT(2)

NNAAMMEE
     mmoouunntt, uunnmmoouunntt - mount or dismount a filesystem

SSYYNNOOPPSSIISS
     ##iinncclluuddee <<ssyyss//ppaarraamm..hh>>
     ##iinncclluuddee <<ssyyss//mmoouunntt..hh>>

     _i_n_t
     mmoouunntt(_i_n_t _t_y_p_e, _c_o_n_s_t _c_h_a_r _*_d_i_r, _i_n_t _f_l_a_g_s, _c_a_d_d_r___t _d_a_t_a);

     _i_n_t
     uunnmmoouunntt(_c_o_n_s_t _c_h_a_r _*_d_i_r, _i_n_t _f_l_a_g_s);

DDEESSCCRRIIPPTTIIOONN
     The mmoouunntt() function grafts a filesystem object onto the system file tree
     at the point _d_i_r. The argument _d_a_t_a describes the filesystem object to be
     mounted.  The argument _t_y_p_e tells the kernel how to interpret _d_a_t_a (See
     _t_y_p_e below).  The contents of the filesystem become available through the
     new mount point _d_i_r. Any files in _d_i_r at the time of a successful mount
     are swept under the carpet so to speak, and are unavailable until the
     filesystem is unmounted.

     The following _f_l_a_g_s may be specified to suppress default semantics which
     affect filesystem access.

     MNT_RDONLY       The filesystem should be treated as read-only; Even the
                      super-user may not write on it.

     MNT_NOEXEC       Do not allow files to be executed from the filesystem.

     MNT_NOSUID       Do not honor setuid or setgid bits on files when execut-
                      ing them.

     MNT_NODEV        Do not interpret special files on the filesystem.

     MNT_SYNCHRONOUS  All I/O to the filesystem should be done synchronously.

     The flag MNT_UPDATE indicates that the mount command is being applied to
     an already mounted filesystem.  This allows the mount flags to be changed
     without requiring that the filesystem be unmounted and remounted.  Some
     filesystems may not allow all flags to be changed.  For example, most
     filesystems will not allow a change from read-write to read-only.

     The _t_y_p_e argument defines the type of the filesystem.  The types of
     filesystems known to the system are defined in <_s_y_s_/_m_o_u_n_t_._h>. _D_a_t_a is a
     pointer to a structure that contains the type specific arguments to
     mount.  The currently supported types of filesystems and their type spe-
     cific data are:

     MOUNT_UFS
           struct ufs_args {
                 char      *fspec;  /* Block special file to mount */
                 int       exflags; /* export related flags */
                 uid_t     exroot;  /* mapping for root uid */
           };

     MOUNT_NFS
           struct nfs_args {
                 struct sockaddr_in *addr; /* file server address */
                 nfsv2fh_t *fh;       /* File handle to be mounted */
                 int       flags;     /* flags */
                 int       wsize;     /* write size in bytes */
                 int       rsize;     /* read size in bytes */
                 int       timeo;     /* initial timeout 0.1 secs */
                 int       retrans;   /* times to retry send */
                 char      *hostname; /* server's name */
           };

     MOUNT_MFS
           struct mfs_args {
                 char      *name;  /* name of backing process */
                 caddr_t   base;   /* base address of the filesystem */
                 u_long    size;   /* size of the filesystem */
           };

     The uummoouunntt() function call disassociates the filesystem from the speci-
     fied mount point _d_i_r.

     The _f_l_a_g_s argument may specify MNT_FORCE to specify that the filesystem
     should be forcibly unmounted even if files are still active.  Active spe-
     cial devices continue to work, but any further accesses to any other ac-
     tive files result in errors even if the filesystem is later remounted.

RREETTUURRNN VVAALLUUEESS
     The mmoouunntt() returns the value 0 if the mount was successful, otherwise -1
     is returned and the variable _e_r_r_n_o is set to indicate the error.

     UUmmoouunntt returns the value 0 if the umount succeeded; otherwise -1 is re-
     turned and the variable _e_r_r_n_o is set to indicate the error.

EERRRROORRSS
     MMoouunntt() will fail when one of the following occurs:

     [EPERM]    The caller is not the super-user.

     [ENAMETOOLONG]
                A component of a pathname exceeded 255 characters, or the en-
                tire length of a path name exceeded 1023 characters.

     [ELOOP]    Too many symbolic links were encountered in translating a
                pathname.

     [ENOENT]   A component of _d_i_r does not exist.

     [ENOTDIR]  A component of _n_a_m_e is not a directory, or a path prefix of
                _s_p_e_c_i_a_l is not a directory.

     [EINVAL]   A pathname contains a character with the high-order bit set.

     [EBUSY]    Another process currently holds a reference to _d_i_r.

     [EFAULT]   _D_i_r points outside the process's allocated address space.

     The following errors can occur for a _u_f_s filesystem mount:

     [ENODEV]   A component of ufs_args _f_s_p_e_c does not exist.

     [ENOTBLK]  _F_s_p_e_c is not a block device.

     [ENXIO]    The major device number of _f_s_p_e_c is out of range (this indi-
                cates no device driver exists for the associated hardware).

     [EBUSY]    _F_s_p_e_c is already mounted.

     [EMFILE]   No space remains in the mount table.

     [EINVAL]   The super block for the filesystem had a bad magic number or


                an out of range block size.

     [ENOMEM]   Not enough memory was available to read the cylinder group in-
                formation for the filesystem.

     [EIO]      An I/O error occurred while reading the super block or cylin-
                der group information.

     [EFAULT]   _F_s_p_e_c points outside the process's allocated address space.

     The following errors can occur for a _n_f_s filesystem mount:

     [ETIMEDOUT]
                _N_f_s timed out trying to contact the server.

     [EFAULT]   Some part of the information described by nfs_args points out-
                side the process's allocated address space.

     The following errors can occur for a _m_f_s filesystem mount:

     [EMFILE]   No space remains in the mount table.

     [EINVAL]   The super block for the filesystem had a bad magic number or
                an out of range block size.

     [ENOMEM]   Not enough memory was available to read the cylinder group in-
                formation for the filesystem.

     [EIO]      An paging error occurred while reading the super block or
                cylinder group information.

     [EFAULT]   _N_a_m_e points outside the process's allocated address space.

     UUmmoouunntt may fail with one of the following errors:

     [EPERM]    The caller is not the super-user.

     [ENOTDIR]  A component of the path is not a directory.

     [EINVAL]   The pathname contains a character with the high-order bit set.

     [ENAMETOOLONG]
                A component of a pathname exceeded 255 characters, or an en-
                tire path name exceeded 1023 characters.

     [ELOOP]    Too many symbolic links were encountered in translating the
                pathname.

     [EINVAL]   The requested directory is not in the mount table.

     [EBUSY]    A process is holding a reference to a file located on the
                filesystem.

     [EIO]      An I/O error occurred while writing cached filesystem informa-
                tion.

     [EFAULT]   _D_i_r points outside the process's allocated address space.

     A _u_f_s or _m_f_s mount can also fail if the maximum number of filesystems are
     currently mounted.

SSEEEE AALLSSOO
     mount(8),  umount(8),  mfs(8)

BBUUGGSS
     Some of the error codes need translation to more obvious messages.

HHIISSTTOORRYY
     MMoouunntt() and uummoouunntt() function calls appeared in Version 6 AT&T UNIX.

4th Berkeley Distribution        July 11, 1993                               4