MODNEXT(2)
β¨ MODNEXT(2) β¨ β return the modid of the next kernel module, bestie π
okay so welcome to the manual page for modnext, aka the "who's next in the kernel module lineup?" system call. manual name is MODNEXT(2), and we're about to vibe check it together. no cap. π«Ά
π NAME π
modnext β return the modid of the next kernel module. that's it, that's the whole name. iconic.
π LIBRARY π
you'll find this in the Standard C Library (libc, -lc). yes queen, link it with -lc. π
π§ SYNOPSIS π§
#include <sys/param.h>
#include <sys/module.h>
int
modnext(int modid);
int
modfnext(int modid);
π DESCRIPTION π
so the modnext() system call returns the modid of the next kernel module β literally the one after modid β or 0 if modid is the last module in the list. it's giving "end of the line, bestie." π
if the modid value is 0, then modnext() will return the modid of the first module. so 0 is your "start from the top" button. β¨
and modfnext()? that one must always be given a valid modid. no exceptions, no shortcuts, no "oops I passed 0." it's not that kind of function. π«
π RETURN VALUES π
the modnext() system call returns the modid of the next module (peep DESCRIPTION above, bestie) or 0. if an error occurs, errno is set to indicate the error. so check that errno, okay? π
π ERRORS π
the only error set by modnext() is ENOENT. it gets set when modid refers to a kernel module that does not exist (aka it's not loaded). so if you're getting ENOENT, the module is simply not there. not loaded, not invited, not on the list. periodt. π
π SEE ALSO π
kldfind(2)kldfirstmod(2)kldload(2)kldnext(2)kldstat(2)kldsym(2)kldunload(2)modfind(2)modstat(2)kld(4)kldstat(8)
π°οΈ HISTORY π°οΈ
the kld interface first appeared in FreeBSD 3.0. vintage, but still serving looks. π
and that's the whole page, bestie. this manual page is from Debian, dated September 28, 2000, and it's literally MODNEXT(2). slay, bye. πβ¨
π¦ 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