Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getmnt(2)

statfs(3)

getmountent(3)

Name

getmountent − get information about mounted file systems without blocking

Syntax

#include <sys/types.h>
#include <sys/param.h>
#include <sys/mount.h>

getmountent(start, buffer, nentries)
int *start;
struct fs_data*buffer;
int nentries;

Description

The getmountent library routine retrieves mounted file system information from memory without blocking. The file system information retrieved (the number of free inodes and blocks) might not be up to date. If the accuracy of the file system information retrieved is critical, you should use statfs or getmnt instead of getmountent.

The start argument is the current logical location within the internal system mount table and must be initially set to 0.  The buffer argument is the holding area for the returned information; that is, the fs_data structures. The size of buffer should be at least the number of entries times the size of the fs_data structure, in bytes.
 
The nentries argument defines the number of mount table entries that are to be retrieved. 

The number of file systems described by the information placed in buffer is returned.  The start argument is updated so that successive calls can be used to retrieve the entire mount table. 

Return Values

Upon successful completion, a value indicating the number of struct fs_data structures stored in buffer is returned.  If there are no more file systems in the mount table, 0 is returned. Otherwise, −1 is returned and the global variable errno is set to indicate the error. 

Diagnostics

EINVAL Invalid argument. 

EFAULT
Either buffer or start causes an illegal address to be referenced. 

EIO An I/O error occurred while reading from the file system. 

See Also

getmnt(2), statfs(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026