execvp has to do ENOEXEC recovery even if `/' in the path
[unix-history] / usr / src / lib / libc / gen / getmntinfo.3
CommitLineData
7241dcec
KM
1.\" Copyright (c) 1989 The Regents of the University of California.
2.\" All rights reserved.
3.\"
91cff1e1 4.\" %sccs.include.redist.man%
7241dcec 5.\"
343e6500 6.\" @(#)getmntinfo.3 6.4 (Berkeley) %G%
7241dcec
KM
7.\"
8.TH GETMNTINFO 3 ""
9.UC 7
10.SH NAME
11getmntinfo - get information about mounted file systems
12.SH SYNOPSIS
13.nf
14.ft B
15#include <sys/types.h>
16#include <sys/mount.h>
17.LP
18.ft B
e14902d3 19int getmntinfo(mntbufp, flags)
7241dcec 20struct statfs **mntbufp;
e14902d3 21int flags
7241dcec
KM
22.fi
23.ft R
24.SH DESCRIPTION
25.I Getmntinfo
26returns an array of
27.I statfs
28structures describing each currently mounted file system (see
29.IR statfs (2)).
e14902d3
KM
30.PP
31.I Getmntinfo
32passes its
33.I flags
34parameter transparently to
35.IR getfsstat (2).
343e6500
KB
36.SH "RETURN VALUE"
37On successful completion,
38.I getmntinfo
39returns a count of the number of elements in the array.
40The pointer to the array is stored into
41.IR mntbufp .
42.PP
43If an error occurs, zero is returned and the external variable
44.I errno
45is set to indicate the error.
46Although the pointer
47.I mntbufp
48will be unmodified, any information previously returned by
49.I getmntinfo
50will be lost.
7241dcec
KM
51.SH BUGS
52All information is contained in a static area,
53so it must be copied if it is to be saved.
343e6500
KB
54.PP
55The memory allocated by
56.I getmntinfo
57cannot be
58.IR free 'd
59by the application.
60.SH ERRORS
61.I Getmntinfo
62may fail and set errno for any of the errors specified for the library
63routines
64.IR getfsstat (2)
65or
66.IR malloc (3).
7241dcec
KM
67.SH SEE ALSO
68getfsstat(2), statfs(2), mount(2), mount(8)