I'm very pleased to announce the release of our new website and documentation using the new toolchain with Hugo and AsciiDoctor. To get more information about the new toolchain please read the FreeBSD Documentation Project Primer[1], Hugo docs[2] and AsciiDoctor docs[3]. Acknowledgment: Benedict Reuschling <bcr@> Glen Barber <gjb@> Hiroki Sato <hrs@> Li-Wen Hsu <lwhsu@> Sean Chittenden <seanc@> The FreeBSD Foundation [1] https://docs.FreeBSD.org/en/books/fdp-primer/ [2] https://gohugo.io/documentation/ [3] https://docs.asciidoctor.org/home/ Approved by: doceng, core
125 lines
3.4 KiB
Groff
125 lines
3.4 KiB
Groff
.\"
|
|
.\" Copyright (c) 1999 Chris Costello
|
|
.\" 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.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
|
.\"
|
|
.\" %FreeBSD: src/lib/libc/sys/modstat.2,v 1.10 2004/07/02 23:52:13 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd September 28, 2000
|
|
.Dt MODSTAT 2
|
|
.Os
|
|
.Sh 名称
|
|
.Nm modstat
|
|
.Nd カーネルモジュールの状態を取得
|
|
.Sh ライブラリ
|
|
.Lb libc
|
|
.Sh 書式
|
|
.In sys/param.h
|
|
.In sys/module.h
|
|
.Ft int
|
|
.Fn modstat "int modid" "struct module_stat *stat"
|
|
.Sh 解説
|
|
.Fn modstat
|
|
システムコールは
|
|
.Fa modid
|
|
で参照されているカーネルモジュールに関する情報を
|
|
.Fa stat
|
|
に格納します。
|
|
.Bd -literal
|
|
struct module_stat {
|
|
int version; /* set to sizeof(module_stat) */
|
|
char name[MAXPATHLEN];
|
|
int refs;
|
|
int id;
|
|
modspecific_t data;
|
|
};
|
|
typedef union modspecific {
|
|
int intval;
|
|
u_int u_intval;
|
|
long longval;
|
|
u_long u_longval;
|
|
} modspecific_t;
|
|
.Ed
|
|
.Pp
|
|
.Bl -tag -width XXXaddress
|
|
.It version
|
|
このフィールドには、
|
|
.Fn modstat
|
|
自体ではなく
|
|
.Fn modstat
|
|
を呼び出したコードによって、上記の構造体のサイズが設定されます。
|
|
.It name
|
|
.Fa modid
|
|
で参照されているモジュールの名前。
|
|
.It refs
|
|
.Fa modid
|
|
で参照されているモジュールの数。
|
|
.It id
|
|
.Fa modid
|
|
で指定されているモジュールの id。
|
|
.It data
|
|
モジュール特有のデータ。
|
|
.El
|
|
.Sh 戻り値
|
|
.Rv -std modstat
|
|
.Sh エラー
|
|
以下のようなエラーが発生しない限り、
|
|
.Fa modid
|
|
によって参照されているモジュールに関する情報が
|
|
.Fa stat
|
|
が指している構造体に代入されます:
|
|
.Bl -tag -width Er
|
|
.It Bq Er ENOENT
|
|
モジュールが見つかりません (おそらくロードされていません)。
|
|
.It Bq Er EINVAL
|
|
.Fa version
|
|
フィールドで指定されているバージョンが適切ではありません。
|
|
適切なバージョンを
|
|
.Fa version
|
|
フィールドで指定しているにも関わらずこのエラーが起こるときは、
|
|
OS 全体か、カーネルまたはプログラム自身を作り直す必要があるかもしれません。
|
|
.It Bq Er EFAULT
|
|
.Xr copyout 9
|
|
関数の中で、ひとつまたは複数あるいはすべてのフィールドを
|
|
.Fa stat
|
|
にコピー中に問題が発生しました。
|
|
.El
|
|
.Sh 関連項目
|
|
.Xr kldfind 2 ,
|
|
.Xr kldfirstmod 2 ,
|
|
.Xr kldload 2 ,
|
|
.Xr kldnext 2 ,
|
|
.Xr kldstat 2 ,
|
|
.Xr kldsym 2 ,
|
|
.Xr kldunload 2 ,
|
|
.Xr modfind 2 ,
|
|
.Xr modfnext 2 ,
|
|
.Xr modnext 2 ,
|
|
.Xr kld 4 ,
|
|
.Xr kldstat 8
|
|
.Sh 歴史
|
|
.Nm kld
|
|
インタフェースは
|
|
.Fx 3.0
|
|
ではじめて登場しました。
|