Commit | Line | Data |
---|---|---|
ae59e04c | 1 | .\" Copyright (c) 1989, 1991 The Regents of the University of California. |
7241dcec KM |
2 | .\" All rights reserved. |
3 | .\" | |
91cff1e1 | 4 | .\" %sccs.include.redist.man% |
7241dcec | 5 | .\" |
ae59e04c | 6 | .\" @(#)getmntinfo.3 6.5 (Berkeley) %G% |
7241dcec | 7 | .\" |
ae59e04c CL |
8 | .Dd |
9 | .Dt GETMNTINFO 3 | |
10 | .Os | |
11 | .Sh NAME | |
12 | .Nm getmntinfo | |
13 | .Nd get information about mounted file systems | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <sys/types.h> | |
16 | .Fd #include <sys/mount.h> | |
17 | .Ft int | |
18 | .Fn getmntinfo "int mntbufp" "int flags" | |
19 | .Sh DESCRIPTION | |
20 | The | |
21 | .Fn getmntinfo | |
22 | function | |
7241dcec | 23 | returns an array of |
ae59e04c | 24 | .Xr statfs |
7241dcec | 25 | structures describing each currently mounted file system (see |
ae59e04c CL |
26 | .Xr statfs 2 ) . |
27 | .Pp | |
28 | The | |
29 | .Fn getmntinfo | |
30 | function | |
e14902d3 | 31 | passes its |
ae59e04c | 32 | .Fa flags |
e14902d3 | 33 | parameter transparently to |
ae59e04c CL |
34 | .Xr getfsstat 2 . |
35 | .Sh RETURN VALUES | |
343e6500 | 36 | On successful completion, |
ae59e04c | 37 | .Fn getmntinfo |
343e6500 KB |
38 | returns a count of the number of elements in the array. |
39 | The pointer to the array is stored into | |
ae59e04c CL |
40 | .Fa mntbufp . |
41 | .Pp | |
343e6500 | 42 | If an error occurs, zero is returned and the external variable |
ae59e04c | 43 | .Va errno |
343e6500 KB |
44 | is set to indicate the error. |
45 | Although the pointer | |
ae59e04c | 46 | .Fa mntbufp |
343e6500 | 47 | will be unmodified, any information previously returned by |
ae59e04c | 48 | .Fn getmntinfo |
343e6500 | 49 | will be lost. |
ae59e04c CL |
50 | .Sh ERRORS |
51 | The | |
52 | .Fn getmntinfo | |
53 | function | |
343e6500 KB |
54 | may fail and set errno for any of the errors specified for the library |
55 | routines | |
ae59e04c | 56 | .Xr getfsstat 2 |
343e6500 | 57 | or |
ae59e04c CL |
58 | .Xr malloc 3 . |
59 | .Sh SEE ALSO | |
60 | .Xr getfsstat 2 , | |
61 | .Xr statfs 2 , | |
62 | .Xr mount 2 , | |
63 | .Xr mount 8 | |
64 | .Sh HISTORY | |
65 | The | |
66 | .Fn getmntinfo | |
67 | function is | |
68 | .Ud . | |
69 | .Sh BUGS | |
70 | The | |
71 | .Fn getmntinfo | |
72 | function writes the array of structures to an internal static object | |
73 | and returns | |
74 | a pointer to that object. Subsequent calls to | |
75 | .Fn getmntinfo | |
76 | will modify the same object. | |
77 | .Pp | |
78 | The memory allocated by | |
79 | .Fn getmntinfo | |
80 | cannot be | |
81 | .Xr free 2 Ns 'd | |
82 | by the application. |