Commit | Line | Data |
---|---|---|
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 | |
11 | getmntinfo - 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 | 19 | int getmntinfo(mntbufp, flags) |
7241dcec | 20 | struct statfs **mntbufp; |
e14902d3 | 21 | int flags |
7241dcec KM |
22 | .fi |
23 | .ft R | |
24 | .SH DESCRIPTION | |
25 | .I Getmntinfo | |
26 | returns an array of | |
27 | .I statfs | |
28 | structures describing each currently mounted file system (see | |
29 | .IR statfs (2)). | |
e14902d3 KM |
30 | .PP |
31 | .I Getmntinfo | |
32 | passes its | |
33 | .I flags | |
34 | parameter transparently to | |
35 | .IR getfsstat (2). | |
343e6500 KB |
36 | .SH "RETURN VALUE" |
37 | On successful completion, | |
38 | .I getmntinfo | |
39 | returns a count of the number of elements in the array. | |
40 | The pointer to the array is stored into | |
41 | .IR mntbufp . | |
42 | .PP | |
43 | If an error occurs, zero is returned and the external variable | |
44 | .I errno | |
45 | is set to indicate the error. | |
46 | Although the pointer | |
47 | .I mntbufp | |
48 | will be unmodified, any information previously returned by | |
49 | .I getmntinfo | |
50 | will be lost. | |
7241dcec KM |
51 | .SH BUGS |
52 | All information is contained in a static area, | |
53 | so it must be copied if it is to be saved. | |
343e6500 KB |
54 | .PP |
55 | The memory allocated by | |
56 | .I getmntinfo | |
57 | cannot be | |
58 | .IR free 'd | |
59 | by the application. | |
60 | .SH ERRORS | |
61 | .I Getmntinfo | |
62 | may fail and set errno for any of the errors specified for the library | |
63 | routines | |
64 | .IR getfsstat (2) | |
65 | or | |
66 | .IR malloc (3). | |
7241dcec KM |
67 | .SH SEE ALSO |
68 | getfsstat(2), statfs(2), mount(2), mount(8) |