]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/sys/modnext.2
zfs: merge openzfs/zfs@a03ebd9be
[FreeBSD/FreeBSD.git] / lib / libc / sys / modnext.2
1 .\"
2 .\" Copyright (c) 1999 Chris Costello
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .Dd September 28, 2000
27 .Dt MODNEXT 2
28 .Os
29 .Sh NAME
30 .Nm modnext
31 .Nd return the modid of the next kernel module
32 .Sh LIBRARY
33 .Lb libc
34 .Sh SYNOPSIS
35 .In sys/param.h
36 .In sys/module.h
37 .Ft int
38 .Fn modnext "int modid"
39 .Ft int
40 .Fn modfnext "int modid"
41 .Sh DESCRIPTION
42 The
43 .Fn modnext
44 system call
45 returns the modid of the next kernel module (that is, the one after
46 .Va modid )
47 or 0 if
48 .Va modid
49 is the last module in the list.
50 .Pp
51 If the
52 .Va modid
53 value is 0, then
54 .Fn modnext
55 will return the modid of the first module.
56 The
57 .Fn modfnext
58 system call
59 must always be given a valid modid.
60 .Sh RETURN VALUES
61 The
62 .Fn modnext
63 system call
64 returns the modid of the next module (see
65 .Sx DESCRIPTION )
66 or 0.
67 If an error
68 occurs,
69 .Va errno
70 is set to indicate the error.
71 .Sh ERRORS
72 The only error set by
73 .Fn modnext
74 is
75 .Er ENOENT ,
76 which is set when
77 .Va modid
78 refers to a kernel module that does not exist (is not loaded).
79 .Sh SEE ALSO
80 .Xr kldfind 2 ,
81 .Xr kldfirstmod 2 ,
82 .Xr kldload 2 ,
83 .Xr kldnext 2 ,
84 .Xr kldstat 2 ,
85 .Xr kldsym 2 ,
86 .Xr kldunload 2 ,
87 .Xr modfind 2 ,
88 .Xr modstat 2 ,
89 .Xr kld 4 ,
90 .Xr kldstat 8
91 .Sh HISTORY
92 The
93 .Nm kld
94 interface first appeared in
95 .Fx 3.0 .