MODFIND(2)
π MODFIND(2) β the system call manual, bestie edition π
okay so real talk, this one is from the System Calls Manual and it's giving "tiny function, huge responsibilities". let's get into it π«Ά
β¨ NAME β¨
modfind β returns the modid of a kernel module
like, that's the whole job. it finds the modid. iconic behaviour honestly π
π LIBRARY π
Standard C Library (libc, -lc)
so yeah she lives in libc, link her like you'd link anything else in there π
π SYNOPSIS π
#include <sys/param.h>
#include <sys/module.h>
int
modfind(const char *modname);
look at her. one function. one const char *. no drama. no cap. β¨
πΈ DESCRIPTION πΈ
so basically, the modfind() system call returns the modid of the kernel module referenced by modname.
that's it. that's the whole vibe. you hand her a module name, she hands you back the modid. main character energy, minimal dialogue π
π¦ RETURN VALUES π¦
modfind() returns the modid of the kernel module referenced by modname. that's the good ending, we love that for you π
but if things go sideways? modfind() returns -1 and sets errno to indicate the error. not the vibe, but at least she tells you why π
π ERRORS π
errno gets set to one of these when modfind() fails, and bestie you're gonna wanna read them:
[EFAULT]β the data required for this operation could not be read from the kernel space. like the kernel just. couldn't hand it over. awkward. π[ENOENT]β the file specified is not loaded in the kernel. she looked. it's not there. it's giving empty shelf at the library π
π₯ SEE ALSO π₯
the whole friend group, fr fr:
kldfind(2)kldfirstmod(2)kldload(2)kldnext(2)kldstat(2)kldsym(2)kldunload(2)modfnext(2)modnext(2)modstat(2)kld(4)kldstat(8)
go read them. iykyk πβ¨
β HISTORY β
the kld interface first appeared in FreeBSD 3.0. a legend from day one, lowkey π
okay that's the whole page, you absolutely ate this one bestie π
β¨ this was the Debian build of the manual, dated September 28, 2000, and the page itself is MODFIND(2) β go forth and find those modids, you've got this π«Άπ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1999 Chris Costello
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms