X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/9bccf70c0258c7cac2dcb80011b2a964d884c552..0a7de7458d150b5d4dffc935ba399be265ef0a1a:/bsd/man/man2/mount.2 diff --git a/bsd/man/man2/mount.2 b/bsd/man/man2/mount.2 index 7d6bac642..586707fa6 100644 --- a/bsd/man/man2/mount.2 +++ b/bsd/man/man2/mount.2 @@ -39,6 +39,7 @@ .Os BSD 4 .Sh NAME .Nm mount , +.Nm fmount, .Nm unmount .Nd mount or dismount a filesystem .Sh SYNOPSIS @@ -47,6 +48,8 @@ .Ft int .Fn mount "const char *type" "const char *dir" "int flags" "void *data" .Ft int +.Fn fmount "const char *type" "int fd" "int flags" "void *data" +.Ft int .Fn unmount "const char *dir" "int flags" .Sh DESCRIPTION The @@ -82,9 +85,6 @@ suppress default semantics which affect filesystem access. .It Dv MNT_RDONLY The filesystem should be treated as read-only; Even the super-user may not write on it. -.It Dv MNT_NOATIME -Do not update the access time on files in the filesystem unless -the modification or status change times are also being updated. .It Dv MNT_NOEXEC Do not allow files to be executed from the filesystem. .It Dv MNT_NOSUID @@ -95,6 +95,8 @@ Do not interpret special files on the filesystem. Union with underlying filesystem instead of obscuring it. .It Dv MNT_SYNCHRONOUS All I/O to the filesystem should be done synchronously. +.It Dv MNT_CPROTECT +Enable data protection on the filesystem if the filesystem is configured for it. .El .Pp The flag @@ -107,61 +109,32 @@ 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. .Pp +The flag +.Dv MNT_RELOAD +causes the vfs subsystem to update its data structures pertaining to +the specified already mounted filesystem. +.Pp The .Fa type argument defines the type of the filesystem. -The types of filesystems known to the system are defined in -.Aq Pa sys/mount.h . +.Pp .Fa Data is a pointer to a structure that contains the type specific arguments to mount. -The currently supported types of filesystems and -their type specific data are: -.Pp -.Dv MOUNT_FFS -.Bd -literal -offset indent -compact -struct ufs_args { - char *fspec; /* block special file to mount */ - struct export_args export; /* network export information */ -}; -.Ed +The format for these argument structures is described in the +manual page for each filesystem. .Pp -.Dv MOUNT_NFS -.Bd -literal -offset indent -compact -struct nfs_args { - int version; /* args structure version */ - struct sockaddr *addr; /* file server address */ - int addrlen; /* length of address */ - int sotype; /* Socket type */ - int proto; /* and Protocol */ - u_char *fh; /* File handle to be mounted */ - int fhsize; /* Size, in bytes, of fh */ - int flags; /* flags */ - int wsize; /* write size in bytes */ - int rsize; /* read size in bytes */ - int readdirsize; /* readdir size in bytes */ - int timeo; /* initial timeout in .1 secs */ - int retrans; /* times to retry send */ - int maxgrouplist; /* Max. size of group list */ - int readahead; /* # of blocks to readahead */ - int leaseterm; /* Term (sec) of lease */ - int deadthresh; /* Retrans threshold */ - char *hostname; /* server's name */ -}; -.Ed -.Pp -.Dv MOUNT_MFS -.Bd -literal -offset indent -compact -struct mfs_args { - char *fspec; /* name to export for statfs */ - struct export_args export; /* if we can export an MFS */ - caddr_t base; /* base of filesystem in mem */ - u_long size; /* size of filesystem */ -}; -.Ed +The +.Fn fmount +function call is equivalent to the +.Fn mount +function call, except in the use of the second argument. +It takes an open file descriptor representing mount point +instead of the string literal containing full path to the mount +point in the filesystem hierarchy. .Pp The -.Fn umount +.Fn unmount function call disassociates the filesystem from the specified mount point .Fa dir . @@ -178,22 +151,27 @@ even if the filesystem is later remounted. .Sh RETURN VALUES The .Fn mount -returns the value 0 if the mount was successful, otherwise -1 is returned +and +.Fn fmount +return the value 0 if the mount was successful, otherwise -1 is returned and the variable .Va errno is set to indicate the error. .Pp -.Nm Umount -returns the value 0 if the umount succeeded; otherwise -1 is returned +.Nm unmount +returns the value 0 if the unmount succeeded; otherwise -1 is returned and the variable .Va errno is set to indicate the error. .Sh ERRORS -.Fn Mount +.Fn mount +and +.Fn fmount will fail when one of the following occurs: .Bl -tag -width [ENAMETOOLONG] .It Bq Er EPERM -The caller is not the super-user. +The caller is not the super-user, and the device-node and the mountpoint +do not have adequate ownership and permissions. .It Bq Er ENAMETOOLONG A component of a pathname exceeded .Dv {NAME_MAX} @@ -223,78 +201,13 @@ Another process currently holds a reference to points outside the process's allocated address space. .El .Pp -The following errors can occur for a -.Em ufs -filesystem mount: -.Bl -tag -width [ENOTBLK] -.It Bq Er ENODEV -A component of ufs_args -.Ar fspec -does not exist. -.It Bq Er ENOTBLK -.Ar Fspec -is not a block device. -.It Bq Er ENXIO -The major device number of -.Ar fspec -is out of range (this indicates no device driver exists -for the associated hardware). -.It Bq Er EBUSY -.Ar Fspec -is already mounted. -.It Bq Er EMFILE -No space remains in the mount table. -.It Bq Er EINVAL -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 -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 EFAULT -.Ar Fspec -points outside the process's allocated address space. -.El -.Pp -The following errors can occur for a -.Em nfs -filesystem mount: -.Bl -tag -width [ETIMEDOUT] -.It Bq Er ETIMEDOUT -.Em Nfs -timed out trying to contact the server. -.It Bq Er EFAULT -Some part of the information described by nfs_args -points outside the process's allocated address space. -.El -.Pp -The following errors can occur for a -.Em mfs -filesystem mount: -.Bl -tag -width [EMFILE] -.It Bq Er EMFILE -No space remains in the mount table. -.It Bq Er EINVAL -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 -group information for the filesystem. -.It Bq Er EIO -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 -.Nm Umount +.Nm unmount may fail with one of the following errors: .Bl -tag -width [ENAMETOOLONG] .It Bq Er EPERM -The caller is not the super-user. +The caller is not the super-user, and the +.Nm mount() +was not done by the user. .It Bq Er ENOTDIR A component of the path is not a directory. .It Bq Er EINVAL @@ -318,22 +231,17 @@ An I/O error occurred while writing cached filesystem information. .Fa Dir points outside the process's allocated address space. .El -.Pp -A -.Em ufs -or -.Em mfs -mount can also fail if the maximum number of filesystems are currently -mounted. .Sh SEE ALSO .Xr mount 8 , -.Xr umount 8 , -.Xr mfs 8 +.Xr unmount 8 , +.Xr open 2 .Sh BUGS Some of the error codes need translation to more obvious messages. .Sh HISTORY -.Fn Mount +.Fn mount and -.Fn umount +.Fn unmount function calls appeared in .At v6 . +.Fn fmount +function call first appeared in macOS version 10.13.