Returns the mount status of file systems, or alters the status of mounted file systems.
Standard C Library (libc.a)
The mntctl subroutine is used to query the status of virtual file systems (also known as mounted file systems). It can also be used to alter the state of mounted file systems.
Each virtual file system (VFS) is described by a vmount structure. This structure is supplied when the VFS is created by the vmount subroutine. The vmount structure is defined in the sys/vmount.h file.
Item | Description |
---|---|
Command | Specifies the operation to be
performed. Valid commands are
defined in the sys/vmount.h file. At present, the only command
is:
|
Buffer | For
the MCTL_QUERY command, the Buffer parameter
points to a data area that will contain an array of the vmount structures.
Because the vmount structure is variable-length, it is necessary
to reference the vmt_length field of each structure to determine
where in the Buffer area the next structure
begins. For the MCTL_REMNT command, the Buffer parameter points to a data area that contains the vmount structure that is passed in. |
Size | Specifies the length, in bytes, of the buffer pointed to by the Buffer parameter. |
For the MCTL_QUERY command, if the mntctl subroutine is successful, the number of vmount structures that are copied into the Buffer parameter is returned. If the Size parameter indicates that the supplied buffer is too small to hold the vmount structures for all of the current VFSs, the mntctl subroutine sets the first word of the Buffer parameter to the required size (in bytes) and returns the value of 0. If the mntctl subroutine otherwise fails, a value of -1 is returned, and the errno global variable is set to indicate the error.
For the MCTL_REMNT command, if the mntctl subroutine fails, a value of -1 is returned, and the errno global variable is set to indicate the error.
The mntctl subroutine fails and the requested operation is not performed if one or both of the following are true:
Item | Description |
---|---|
EINVAL | The Command parameter is not recognized, or the Size parameter is not a positive value. |
EFAULT | The Buffer parameter points to a location outside of the allocated address space of the process. |