getmountent(3) Library Functions Manual 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 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 or instead of
The start argument is the current logical location within the internal system mount table and must be initially set to 0. The buffer argu-
ment is the holding area for the returned information; that is, the structures. The size of buffer should be at least the number of
entries times the size of the 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 structures stored in buffer is returned. If there are no more file systems in
the mount table, is returned. Otherwise, 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 Alsogetmnt(2), statfs(3)getmountent(3)
Check Out this Related Man Page
GETFSSTAT(2) BSD System Calls Manual GETFSSTAT(2)NAME
getfsstat -- get list of all mounted file systems
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>
int
getfsstat(struct statfs *buf, long bufsize, int flags);
DESCRIPTION
The getfsstat() system call returns information about all mounted file systems. The buf argument is a pointer to statfs structures, as
described in statfs(2).
Fields that are undefined for a particular file system are set to -1. The buffer is filled with an array of statfs structures, one for each
mounted file system up to the byte count specified by bufsize. Note, the bufsize argument is the number of bytes that buf can hold, not the
count of statfs structures it will hold.
If buf is given as NULL, getfsstat() returns just the number of mounted file systems.
Normally flags should be specified as MNT_WAIT. If flags is set to MNT_NOWAIT, getfsstat() will return the information it has available
without requesting an update from each file system. Thus, some of the information will be out of date, but getfsstat() will not block wait-
ing for information from a file system that is unable to respond.
RETURN VALUES
Upon successful completion, the number of statfs structures is returned. Otherwise, -1 is returned and the global variable errno is set to
indicate the error.
ERRORS
The getfsstat() system call fails if one or more of the following are true:
[EFAULT] The buf argument points to an invalid address.
[EIO] An I/O error occurred while reading from or writing to the file system.
SEE ALSO statfs(2), fstab(5), mount(8)HISTORY
The getfsstat() system call first appeared in 4.4BSD.
BSD November 20, 2003 BSD
<h1>A short history of UNIX</h1>
<p>In the late 1960's Ken Thompsom joined the computing-science research group at Bell
Laboratories, which is the research arm of the giant American corporation ATT. He and many
colleagues had been collaborating with MIT and GE on the development of an... (0 Replies)
We have quite a few threads about this subject. I have collected some of them and arranged them by the OS which is primarily discussed in the thread. That is because the exact procedure depends on the OS involved. What's more, since you often need to interact with the boot process, the... (0 Replies)
I'm writing a command shell, and I want to be able to detect when the user presses an arrow key (otherwise it just prints [[A, [[B, etc.). I know it's relatively easy (although somewhat more time-consuming) to detect keystrokes in noncanonical mode, but I've noticed that the bash shell detects... (4 Replies)
I'm learning off Linux (Ubuntu) right now. I want to move up to Unix, but I don't want to rush like I did when it came to Windows --> to Linux. What is the best Unix OS that fits in pretty well with Ubuntu.
In other words is there kind of an equal Linux with Unix?
Also what do I need to... (10 Replies)
I noticed my hostname is <my-full-name>s-macbook.local. I'm not sure exactly what information leaves the local network, and whether the hostname is included, but if it is, this would mean people on the Internet can look at my hostname and see who I am. Before anyone says that's not possible,... (4 Replies)