KLDUNLOAD(2)
β¨ NAME β¨
Okay bestie, this is the KLDUNLOAD(2) manual page β it's for kldunload and kldunloadf, aka the calls that unload kld files. π
π LIBRARY π
Standard C Library (libc, -lc). Slay.
π§ SYNOPSIS π§
#include <sys/linker.h>
int
kldunload(int fileid);
int
kldunloadf(int fileid, int flags);
π DESCRIPTION π
The kldunload() system call unloads a kld file from the kernel that was previously linked via kldload(2). No cap.
The kldunloadf() system call accepts an additional flags argument, which may be one of LINKER_UNLOAD_NORMAL, giving the same behavior as kldunload(), or LINKER_UNLOAD_FORCE, which causes the unload to ignore a failure to quiesce the module. Iconic behavior honestly. β¨
π«Ά RETURN VALUES π«Ά
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error. That's the vibe check. π
π¨ ERRORS π¨
The file referred to by fileid is unloaded unless:
[EPERM]β You do not have access to unlink the file from the kernel.[ENOENT]β The file was not found.[EBUSY]β You attempted to unload a file linked by the kernel.[EINVAL]β Thekldunloadf()system call was passed invalid flags.
π SEE ALSO π
kldfind(2), kldfirstmod(2), kldload(2), kldnext(2), kldstat(2), kldsym(2), modfind(2), modfnext(2), modnext(2), modstat(2), kld(4), kldunload(8).
πΈ HISTORY πΈ
The kld interface first appeared in FreeBSD 3.0. Periodt.
Bye bestie β this KLDUNLOAD(2) page is from Debian, dated December 25, 2008. ππ¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1999 Chris Costello
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms