BSD 4_4_Lite2 release
[unix-history] / usr / src / lib / libc / sys / mount.2
index 7a6198b..0d95386 100644 (file)
@@ -1,11 +1,37 @@
-.\" Copyright (c) 1980, 1989 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1980, 1989, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\"
-.\" %sccs.include.redist.man%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.\"     @(#)mount.2    6.11 (Berkeley) %G%
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
 .\"
 .\"
-.Dd 
+.\"     @(#)mount.2    8.3 (Berkeley) 5/24/95
+.\"
+.Dd May 24, 1995
 .Dt MOUNT 2
 .Os BSD 4
 .Sh NAME
 .Dt MOUNT 2
 .Os BSD 4
 .Sh NAME
@@ -13,6 +39,7 @@
 .Nm unmount
 .Nd mount or dismount a filesystem
 .Sh SYNOPSIS
 .Nm unmount
 .Nd mount or dismount a filesystem
 .Sh SYNOPSIS
+.Fd #include <sys/param.h>
 .Fd #include <sys/mount.h>
 .Ft int
 .Fn mount "int type" "const char *dir" "int flags" "caddr_t data"
 .Fd #include <sys/mount.h>
 .Ft int
 .Fn mount "int type" "const char *dir" "int flags" "caddr_t data"
@@ -48,72 +75,53 @@ The following
 .Ar flags
 may be specified to
 suppress default semantics which affect filesystem access.
 .Ar flags
 may be specified to
 suppress default semantics which affect filesystem access.
-.Bl -tag -width M_SYNCHRONOUS
-.It Dv M_RDONLY
-The file system should be treated as read-only;
+.Bl -tag -width MNT_SYNCHRONOUS
+.It Dv MNT_RDONLY
+The filesystem should be treated as read-only;
 Even the super-user may not write on it.
 Even the super-user may not write on it.
-.It Dv M_NOEXEC
-Do not allow files to be executed from the file system.
-.It Dv M_NOSUID
+.It Dv MNT_NOEXEC
+Do not allow files to be executed from the filesystem.
+.It Dv MNT_NOSUID
 Do not honor setuid or setgid bits on files when executing them.
 Do not honor setuid or setgid bits on files when executing them.
-.It Dv M_NODEV
-Do not interpret special files on the file system.
-.It Dv M_SYNCHRONOUS
-All I/O to the file system should be done synchronously.
+.It Dv MNT_NODEV
+Do not interpret special files on the filesystem.
+.It Dv MNT_SYNCHRONOUS
+All I/O to the filesystem should be done synchronously.
 .El
 .Pp
 The flag
 .El
 .Pp
 The flag
-.Dv M_UPDATE
+.Dv MNT_UPDATE
 indicates that the mount command is being applied 
 indicates that the mount command is being applied 
-to an already mounted file system.
+to an already mounted filesystem.
 This allows the mount flags to be changed without requiring
 This allows the mount flags to be changed without requiring
-that the file system be unmounted and remounted.
-Some file systems may not allow all flags to be changed.
+that the filesystem be unmounted and remounted.
+Some filesystems may not allow all flags to be changed.
 For example,
 For example,
-most file systems will not allow a change from read-write to read-only.
+most filesystems will not allow a change from read-write to read-only.
 .Pp
 The
 .Fa type
 .Pp
 The
 .Fa type
-argument defines the type of the file system.
-The types of file systems known to the system are defined in
-.Aq Pa sys/mount.h .
+argument names the filesystem.
+The types of filesystems known to the system can be obtained with
+.Xr sysctl 8
+by using the command:
+.Bd -literal -offset indent
+sysctl vfs
+.Ed
+.Pp
 .Fa Data
 is a pointer to a structure that contains the type
 specific arguments to mount.
 .Fa Data
 is a pointer to a structure that contains the type
 specific arguments to mount.
-The currently supported types of file systems and
-their type specific data are:
-.Pp
-.Dv MOUNT_UFS
-.Bd -literal -compact -offset indent
-struct ufs_args {
-       char    *fspec; /* Block special file to mount */
-       int     exflags;        /* export related flags */
-       uid_t   exroot; /* mapping for root uid */
-};
-.Ed
-.Pp
-.Dv MOUNT_NFS
-.Bd -literal -compact -offset indent
-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 in 0.1 secs */
-       int     retrans;        /* times to retry send */
-       char    *hostname;      /* server's name */
-};
-.Ed
-.Pp
-.Dv MOUNT_MFS
-.Bd -literal -compact -offset indent
-struct mfs_args {
-       char    *name;  /* name of backing process */
-       caddr_t base;   /* base address of the file system */
-       u_long  size;   /* size of the file system */
-};
-.Ed
+The format for these argument structures is described in the
+manual page for each filesystem.
+By convention filesystem manual pages are named
+by prefixing ``mount_'' to the name of the filesystem as returned by
+.Xr sysctl 8 .
+Thus the
+.Nm NFS
+filesystem is described by the
+.Xr mount_nfs 8
+manual page.
 .Pp
 The
 .Fn umount
 .Pp
 The
 .Fn umount
@@ -123,17 +131,13 @@ mount point
 .Pp
 The
 .Fa flags
 .Pp
 The
 .Fa flags
-argument may have one of the following values:
-.Bl -tag -width  M_SYNCHRONOUS
-.It Dv MNT_NOFORCE
-The unmount should fail if any files are active on the file system.
-.It Dv MNT_FORCE
-The file system should be forcibly unmounted even if files are
+argument may specify
+.Dv MNT_FORCE
+to specify that the filesystem should be forcibly unmounted even if files are
 still active.
 Active special devices continue to work,
 but any further accesses to any other active files result in errors
 still active.
 Active special devices continue to work,
 but any further accesses to any other active files result in errors
-even if the file system is later remounted.
-.El
+even if the filesystem is later remounted.
 .Sh RETURN VALUES
 The
 .Fn mount
 .Sh RETURN VALUES
 The
 .Fn mount
@@ -181,7 +185,7 @@ points outside the process's allocated address space.
 .Pp
 The following errors can occur for a
 .Em ufs
 .Pp
 The following errors can occur for a
 .Em ufs
-file system mount:
+filesystem mount:
 .Bl -tag -width [ENOTBLK]
 .It Bq Er ENODEV
 A component of ufs_args
 .Bl -tag -width [ENOTBLK]
 .It Bq Er ENODEV
 A component of ufs_args
@@ -201,11 +205,11 @@ is already mounted.
 .It Bq Er EMFILE
 No space remains in the mount table.
 .It Bq Er EINVAL
 .It Bq Er EMFILE
 No space remains in the mount table.
 .It Bq Er EINVAL
-The super block for the file system had a bad magic
+The super block for the filesystem had a bad magic
 number or an out of range block size.
 .It Bq Er ENOMEM
 Not enough memory was available to read the cylinder
 number or an out of range block size.
 .It Bq Er ENOMEM
 Not enough memory was available to read the cylinder
-group information for the file system.
+group information for the filesystem.
 .It Bq Er EIO
 An I/O error occurred while reading the super block or
 cylinder group information.
 .It Bq Er EIO
 An I/O error occurred while reading the super block or
 cylinder group information.
@@ -216,7 +220,7 @@ points outside the process's allocated address space.
 .Pp
 The following errors can occur for a
 .Em nfs
 .Pp
 The following errors can occur for a
 .Em nfs
-file system mount:
+filesystem mount:
 .Bl -tag -width [ENOTBLK]
 .It Bq Er ETIMEDOUT
 .Em Nfs
 .Bl -tag -width [ENOTBLK]
 .It Bq Er ETIMEDOUT
 .Em Nfs
@@ -228,25 +232,25 @@ points outside the process's allocated address space.
 .Pp
 The following errors can occur for a
 .Em mfs
 .Pp
 The following errors can occur for a
 .Em mfs
-file system mount:
+filesystem mount:
 .Bl -tag -width [ENOTBLK]
 .It Bq Er EMFILE
 No space remains in the mount table.
 .It Bq Er EINVAL
 .Bl -tag -width [ENOTBLK]
 .It Bq Er EMFILE
 No space remains in the mount table.
 .It Bq Er EINVAL
-The super block for the file system had a bad magic
+The super block for the filesystem had a bad magic
 number or an out of range block size.
 .It Bq Er ENOMEM
 Not enough memory was available to read the cylinder
 number or an out of range block size.
 .It Bq Er ENOMEM
 Not enough memory was available to read the cylinder
-group information for the file system.
+group information for the filesystem.
 .It Bq Er EIO
 .It Bq Er EIO
-An paging error occurred while reading the super block or
+A paging error occurred while reading the super block or
 cylinder group information.
 .It Bq Er EFAULT
 .Em Name
 points outside the process's allocated address space.
 .El
 .Pp
 cylinder group information.
 .It Bq Er EFAULT
 .Em Name
 points outside the process's allocated address space.
 .El
 .Pp
-.Em Umount
+.Nm Umount
 may fail with one of the following errors:
 .Bl -tag -width [ENOTBLK]
 .It Bq Er EPERM
 may fail with one of the following errors:
 .Bl -tag -width [ENOTBLK]
 .It Bq Er EPERM
@@ -264,9 +268,9 @@ Too many symbolic links were encountered in translating the pathname.
 The requested directory is not in the mount table.
 .It Bq Er EBUSY
 A process is holding a reference to a file located
 The requested directory is not in the mount table.
 .It Bq Er EBUSY
 A process is holding a reference to a file located
-on the file system.
+on the filesystem.
 .It Bq Er EIO
 .It Bq Er EIO
-An I/O error occurred while writing cached file system information.
+An I/O error occurred while writing cached filesystem information.
 .It Bq Er EFAULT
 .Fa Dir
 points outside the process's allocated address space.
 .It Bq Er EFAULT
 .Fa Dir
 points outside the process's allocated address space.
@@ -281,7 +285,7 @@ mounted.
 .Sh SEE ALSO
 .Xr mount 8 ,
 .Xr umount 8 ,
 .Sh SEE ALSO
 .Xr mount 8 ,
 .Xr umount 8 ,
-.Xr mfs 8
+.Xr sysctl 8
 .Sh BUGS
 Some of the error codes need translation to more obvious messages.
 .Sh HISTORY
 .Sh BUGS
 Some of the error codes need translation to more obvious messages.
 .Sh HISTORY