Makes a file system available for use.
Standard C Library (libc.a)
int vmount (VMount, Size) struct vmount *VMount; int Size;
int mount (Device, Path, Flags) char *Device; char *Path; int Flags;
The vmount subroutine mounts a file system, thereby making the file available for use. The vmount subroutine effectively creates what is known as a virtual file system. After a file system is mounted, references to the path name that is to be mounted over refer to the root directory on the mounted file system.
A directory can only be mounted over a directory, and a file can only be mounted over a file. (The file or directory may be a symbolic link.)
Therefore, the vmount subroutine can provide the following types of mounts:
A mount to a directory or a file can be issued if the calling process has root user authority or is in the system group and has write access to the mount point.
To mount a block device, remote file, or remote directory, the calling process must also have root user authority.
The mount subroutine only allows mounts of a block device over a local directory with the default file system type. The mount subroutine searches the /etc/filesystems file to find a corresponding stanza for the desired file system.
Note: The mount subroutine interface is provided only for compatibility with previous releases of the operating system. The use of the mount subroutine is strongly discouraged by normal application programs.
If the directory you are trying to mount over has the sticky bit set to on, you must either own that directory or be the root user for the mount to succeed. This restriction applies only to directory-over-directory mounts.
|Device||A path name identifying the block device (also called a special file) that contains the physical file system.|
|Path||A path name identifying the directory on which the file system is to be mounted.|
|Flags|| Values that define characteristics of the object to be mounted.
Currently these values are defined in the /usr/include/sys/vmount.h file:
|VMount|| A pointer to a variable-length vmount structure. This structure
is defined in the sys/vmount.h file.
|Size||Specifies the size, in bytes, of the supplied data area.|
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned, and the errno global variable is set to indicate the error.
The mount and vmount subroutines fail and the virtual file system is not created if any of the following is true:
|EACCES||The calling process does not have write permission on the stub directory (the directory to be mounted over).|
|EBUSY||VMT_OBJECT specifies a device that is already mounted or an object that is open for writing, or the kernel's mount table is full.|
|EFAULT||The VMount parameter points to a location outside of the allocated address space of the process.|
|EFBIG||The size of the file system is too big.|
|EFORMAT||An internal inconsistency has been detected in the file system.|
|EINVAL||The contents of the VMount parameter are unintelligible (for example, the vmt_gfstype is unrecognizable, or the file system implementation does not understand the VMT_INFO provided).|
|ENOSYS||The file system type requested has not been configured.|
|ENOTBLK||The object to be mounted is not a file, directory, or device.|
|ENOTDIR||The types of VMT_OBJECT and VMT_STUB are incompatible.|
|EPERM||VMT_OBJECT specifies a block device, and the calling process does not have root user authority.|
|EROFS||An attempt has been made to mount a file system for read/write when the file system cannot support writing.|
The mount and vmount subroutines can also fail if additional errors occur.
These subroutines are part of Base Operating System (BOS) Runtime.
The mntctl subroutine, umount subroutine.
The mount command, umount command.
Files, Directories, and File Systems for Programmers in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.
Understanding Mount Helpers in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs explains and examines the execution syntax of mount helpers.