KLDUNLOAD(2)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

✨ 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] β€” The kldunloadf() 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