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 42The 43.Fn modnext 44system call 45returns the modid of the next kernel module (that is, the one after 46.Va modid ) 47or 0 if 48.Va modid 49is the last module in the list. 50.Pp 51If the 52.Va modid 53value is 0, then 54.Fn modnext 55will return the modid of the first module. 56The 57.Fn modfnext 58system call 59must always be given a valid modid. 60.Sh RETURN VALUES 61The 62.Fn modnext 63system call 64returns the modid of the next module (see 65.Sx DESCRIPTION ) 66or 0. 67If an error 68occurs, 69.Va errno 70is set to indicate the error. 71.Sh ERRORS 72The only error set by 73.Fn modnext 74is 75.Er ENOENT , 76which is set when 77.Va modid 78refers 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 92The 93.Nm kld 94interface first appeared in 95.Fx 3.0 . 96