[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

mntctl Subroutine


Returns information about the mount status of the system.


Standard C Library (libc.a)


#include <sys/mntctl.h>
#include <sys/vmount.h>

int mntctl ( Command, Size, Buffer)
int Command;
int Size;
char *Buffer;


The mntctl subroutine is used to query the status of virtual file systems (also known as 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.


Command Specifies the operation to be performed. Valid commands are defined in the sys/vmount.h file. At present, the only command is:
Query mount information.
Buffer Points to a data area that will contain an array of vmount structures. This data area holds the information returned by the query command. Since 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.
Size Specifies the length, in bytes, of the buffer pointed to by the Buffer parameter.

Return Values

If the mntctl subroutine is successful, the number of vmount structures copied into the Buffer parameter is returned. If the Size parameter indicates the supplied buffer is too small to hold the vmount structures for all the current VFSs, the mntctl subroutine sets the first word of the Buffer parameter to the required size (in bytes) and returns the value 0. If the mntctl subroutine otherwise fails, a value of -1 is returned, and the errno global variable is set to indicate the error.

Error Codes

The mntctl subroutine fails and the requested operation is not performed if one or both of the following are true:

EINVAL The Command parameter is not MCTL_QUERY, 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.

Related Information

The uvmount or umount subroutine, vmount or mount subroutine.

Files, Directories, and File Systems for Programmers in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]