.\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)getmntinfo.3 8.1 (Berkeley) 6/9/93 .\" .\" $FreeBSD$ .Dd June 9, 1993 .Dt GETMNTINFO 3 .Os .Sh 名称 .Nm getmntinfo .Nd マウントしたファイルシステム情報の取得 .Sh 書式 .Fd #include .Fd #include .Fd #include .Ft int .Fn getmntinfo "struct statfs **mntbufp" "int flags" .Sh 解説 .Fn getmntinfo 関数は、現在マウントしているファイルシステムをそれぞれ記述する、 .Fn statfs 構造体の配列を返します ( .Xr statfs 2 を参照してください)。 .Pp .Fn getmntinfo 関数は、その .Fa flags パラメータを透過的に .Xr getfsstat 2 へ渡します。 .Sh 戻り値 無事に完了した場合、 .Fn getmntinfo は目的の配列にある要素数のカウント返します。配列のポインタは .Fa mntbufp に格納されます。 エラーが起こると 0 が返り、エラーを示すために外部変数 .Va errno が設定されます。ポインタ .Fa mntbufp は改変されませんが、 .Fn getmntinfo によって前に返されたすべての情報は失われます。 .Pp .Sh エラー .Fn getmntinfo 関数は失敗することがあり、ライブラリルーチン .Xr getfsstat 2 または .Xr malloc 3 のエラーとして指定される .Va errno を返します。 .Sh 関連項目 .Xr getfsstat 2 , .Xr mount 2 , .Xr statfs 2 , .Xr mount 8 .Sh 歴史 .Fn getmntinfo 関数は .Bx 4.4 で最初に取り入れられました。 .Sh バグ .Fn getmntinfo 関数は構造体の配列を内部静的オブジェクトに書き込み、その オブジェクトのポインタを返します。以後の .Fn getmntinfo の呼び出しは同じオブジェクトを改変します。 .Pp .Fn getmntinfo によって割り振られたメモリは、アプリケーションによって .Xr free 3 できません。