---
name: "kld"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/kld"
---

# kld(3)

kld utility functions

## NAME

**kld\_isloaded**, **kld\_load** – kld utility functions

## LIBRARY

System Utilities Library (libutil, -lutil)

## SYNOPSIS

**#include \<libutil.h\>**

*int*\

**kld\_isloaded**(*const char \*name*);

*int*\

**kld\_load**(*const char \*name*);

## DESCRIPTION

These functions facilitate loading kernel modules from userland applications.

The **kld\_isloaded**() function takes a name and returns a non-zero value if a module of that name is currently loaded. The name can be either the name of a module file (*cpufreq.ko*), the same name without the *.ko* extension (*cpufreq*), or the name of a module contained within that file (*cpu/ichss*). Only the latter will return correct results if the module is compiled into the kernel.

The **kld\_load**() function is a simple wrapper around the [kldload(2)](/kldload/2.md) function. It returns zero if and only if the corresponding **kldload**() call succeeded or returned EEXIST (signifying that the requested module was already loaded).

## SEE ALSO

[kldfirstmod(2)](/kldfirstmod/2.md), [kldload(2)](/kldload/2.md), [kldnext(2)](/kldnext/2.md), [kldstat(2)](/kldstat/2.md), [modfnext(2)](/modfnext/2.md), [modstat(2)](/modstat/2.md), [kld(4)](/kld/4.md)

## HISTORY

The **kld\_isloaded**() and **kld\_load**() functions first appeared in FreeBSD 6.3.

## AUTHORS

The **kld\_isloaded**() and **kld\_load**() functions and this manual page were written by Dag-Erling Smørgrav ⟨*des@FreeBSD.org*⟩.
