MODFIND(2)
π MODFIND(2) β System Calls Manual π
hey bestie, welcome to modfind(2) β the tiny system call with main character energy. no cap, it's here to fetch a kernel module's modid and dip. π¦
πΈ NAME πΈ
modfind β returns the modid of a kernel module. literally that's it, and it ate. π
π«Ά LIBRARY π«Ά
Standard C Library (libc, -lc). link it like you mean it, bestie. π
β¨ SYNOPSIS β¨
okay so here's the summoning code, exactly as the manpage gods wrote it:
#include <sys/param.h>
#include <sys/module.h>
int
modfind(const char *modname);
π¦ DESCRIPTION π¦
The modfind() system call returns the modid of the kernel module referenced by modname. so you hand it a module name, it hands you back the ID. no extra lore, just vibes and kernel module matching. π
π₯ RETURN VALUES π₯
The modfind() system call returns the modid of the kernel module referenced by modname. iconic behavior.
Upon error, modfind() returns -1 and sets errno to indicate the error. so if you see -1, check errno β it's giving "something went wrong, here's the receipt." π
π ERRORS π
errno is set to the following if modfind() fails:
EFAULTβ The data required for this operation could not be read from the kernel space. ngl, kernel space wasn't giving what needed to be gave. πENOENTβ The file specified is not loaded in the kernel. bestie, that thing is not loaded in the kernel, periodt. π
π SEE ALSO π
go read these next, iykyk: kldfind(2), kldfirstmod(2), kldload(2), kldnext(2), kldstat(2), kldsym(2), kldunload(2), modfnext(2), modnext(2), modstat(2), kld(4), kldstat(8). π
π HISTORY π
The kld interface first appeared in FreeBSD 3.0. vintage but still slaying. β
π cute sign-off: this page is from Debian, dated September 28, 2000 β mwah, bye bestie! π
π¦ 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