MODNEXT(2)

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

πŸ’– MODNEXT(2) πŸ’–

okay so this is the System Calls Manual entry for modnext, and we are about to make kernel module IDs make sense, bestie. No gatekeeping, just vibes and facts. πŸ¦‹


🌸 NAME 🌸

modnext β€” return the modid of the next kernel module. periodt. πŸ’…

🧚 LIBRARY 🧚

Standard C Library (libc, -lc) β€” iconic, loaded, and ready. ✨

πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/param.h>
#include <sys/module.h>

int
modnext(int modid);

int
modfnext(int modid);

πŸ¦‹ DESCRIPTION πŸ¦‹

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. slay.

If the modid value is 0, then modnext() will return the modid of the first module. cute, right?

The modfnext() system call must always be given a valid modid.

🚨 no cap, bestie: modfnext() does not play around β€” it must always be given a valid modid. No fake IDs, no guessing. πŸ’€

πŸ‘‘ RETURN VALUES πŸ‘‘

The modnext() system call returns the modid of the next module (see β€œDESCRIPTION”) or 0. If an error occurs, errno is set to indicate the error. that's the whole return-value vibe. πŸ’œ

πŸ’€ ERRORS πŸ’€

The only error set by modnext() is ENOENT, which is set when modid refers to a kernel module that does not exist (is not loaded). so if it's not loaded, it's not showing up β€” simple as that. 🫢

🌈 SEE ALSO 🌈

πŸ•°οΈ HISTORY πŸ•°οΈ

The kld interface first appeared in FreeBSD 3.0. a classic. ⭐


made with πŸ’– from Debian, dated September 28, 2000 β€” that's MODNEXT(2) signing off, mwah πŸ’…

πŸ“¦ where this page comes from