1*1eaf0ac3Slogwang.\"- 2*1eaf0ac3Slogwang.\" Copyright (c) 2006 Dag-Erling Coïdan Smørgrav 3*1eaf0ac3Slogwang.\" All rights reserved. 4*1eaf0ac3Slogwang.\" 5*1eaf0ac3Slogwang.\" Redistribution and use in source and binary forms, with or without 6*1eaf0ac3Slogwang.\" modification, are permitted provided that the following conditions 7*1eaf0ac3Slogwang.\" are met: 8*1eaf0ac3Slogwang.\" 1. Redistributions of source code must retain the above copyright 9*1eaf0ac3Slogwang.\" notice, this list of conditions and the following disclaimer. 10*1eaf0ac3Slogwang.\" 2. Redistributions in binary form must reproduce the above copyright 11*1eaf0ac3Slogwang.\" notice, this list of conditions and the following disclaimer in the 12*1eaf0ac3Slogwang.\" documentation and/or other materials provided with the distribution. 13*1eaf0ac3Slogwang.\" 14*1eaf0ac3Slogwang.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15*1eaf0ac3Slogwang.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16*1eaf0ac3Slogwang.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17*1eaf0ac3Slogwang.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18*1eaf0ac3Slogwang.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19*1eaf0ac3Slogwang.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20*1eaf0ac3Slogwang.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21*1eaf0ac3Slogwang.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22*1eaf0ac3Slogwang.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23*1eaf0ac3Slogwang.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24*1eaf0ac3Slogwang.\" SUCH DAMAGE. 25*1eaf0ac3Slogwang.\" 26*1eaf0ac3Slogwang.\" $FreeBSD$ 27*1eaf0ac3Slogwang.\" 28*1eaf0ac3Slogwang.Dd February 18, 2006 29*1eaf0ac3Slogwang.Dt KLD 3 30*1eaf0ac3Slogwang.Os 31*1eaf0ac3Slogwang.Sh NAME 32*1eaf0ac3Slogwang.Nm kld_isloaded , 33*1eaf0ac3Slogwang.Nm kld_load 34*1eaf0ac3Slogwang.Nd kld utility functions 35*1eaf0ac3Slogwang.Sh LIBRARY 36*1eaf0ac3Slogwang.Lb libutil 37*1eaf0ac3Slogwang.Sh SYNOPSIS 38*1eaf0ac3Slogwang.In libutil.h 39*1eaf0ac3Slogwang.Ft int 40*1eaf0ac3Slogwang.Fn kld_isloaded "const char *name" 41*1eaf0ac3Slogwang.Ft int 42*1eaf0ac3Slogwang.Fn kld_load "const char *name" 43*1eaf0ac3Slogwang.Sh DESCRIPTION 44*1eaf0ac3SlogwangThese functions facilitate loading kernel modules from userland 45*1eaf0ac3Slogwangapplications. 46*1eaf0ac3Slogwang.Pp 47*1eaf0ac3SlogwangThe 48*1eaf0ac3Slogwang.Fn kld_isloaded 49*1eaf0ac3Slogwangfunction takes a name and returns a non-zero value if a module of that 50*1eaf0ac3Slogwangname is currently loaded. 51*1eaf0ac3SlogwangThe name can be either the name of a module file 52*1eaf0ac3Slogwang.Pq Pa cpufreq.ko , 53*1eaf0ac3Slogwangthe same name without the 54*1eaf0ac3Slogwang.Pa .ko 55*1eaf0ac3Slogwangextension 56*1eaf0ac3Slogwang.Pq Pa cpufreq , 57*1eaf0ac3Slogwangor the name of a module contained within that file 58*1eaf0ac3Slogwang.Pq Pa cpu/ichss . 59*1eaf0ac3SlogwangOnly the latter will return correct results if the module is compiled 60*1eaf0ac3Slogwanginto the kernel. 61*1eaf0ac3Slogwang.Pp 62*1eaf0ac3SlogwangThe 63*1eaf0ac3Slogwang.Fn kld_load 64*1eaf0ac3Slogwangfunction is a simple wrapper around the 65*1eaf0ac3Slogwang.Xr kldload 2 66*1eaf0ac3Slogwangfunction. 67*1eaf0ac3SlogwangIt returns zero if and only if the corresponding 68*1eaf0ac3Slogwang.Fn kldload 69*1eaf0ac3Slogwangcall succeeded or returned 70*1eaf0ac3Slogwang.Er EEXIST 71*1eaf0ac3Slogwang(signifying that the requested module was already loaded). 72*1eaf0ac3Slogwang.Sh SEE ALSO 73*1eaf0ac3Slogwang.Xr kldfirstmod 2 , 74*1eaf0ac3Slogwang.Xr kldload 2 , 75*1eaf0ac3Slogwang.Xr kldnext 2 , 76*1eaf0ac3Slogwang.Xr kldstat 2 , 77*1eaf0ac3Slogwang.Xr modfnext 2 , 78*1eaf0ac3Slogwang.Xr modstat 2 , 79*1eaf0ac3Slogwang.Xr kld 4 80*1eaf0ac3Slogwang.Sh HISTORY 81*1eaf0ac3SlogwangThe 82*1eaf0ac3Slogwang.Fn kld_isloaded 83*1eaf0ac3Slogwangand 84*1eaf0ac3Slogwang.Fn kld_load 85*1eaf0ac3Slogwangfunctions first appeared in 86*1eaf0ac3Slogwang.Fx 6.3 . 87*1eaf0ac3Slogwang.Sh AUTHORS 88*1eaf0ac3SlogwangThe 89*1eaf0ac3Slogwang.Fn kld_isloaded 90*1eaf0ac3Slogwangand 91*1eaf0ac3Slogwang.Fn kld_load 92*1eaf0ac3Slogwangfunctions and this manual page were written by 93*1eaf0ac3Slogwang.An Dag-Erling Sm\(/orgrav Aq Mt [email protected] . 94