[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1

mntctl Subroutine

Purpose

Returns information about the mount status of the system.

Library

Standard C Library (libc.a)

Syntax

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

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

Description

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.

Parameters

Command Specifies the operation to be performed. Valid commands are defined in the sys/vmount.h file. At present, the only command is:
MCTL_QUERY
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.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The uvmount or umount subroutine, vmount or mount subroutine.

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


[ Previous | Next | Contents | Glossary | Home | Search ]