KLDFIRSTMOD(2)
okay so bestie, we're in the System Calls Manual, and this page is KLDFIRSTMOD(2). no cap, it's a tiny syscall page but it's lowkey important if you're messing with kld stuff. π
πΈ NAME πΈ
kldfirstmod β return the first module id from the kld file you specified. periodt. π¦
π LIBRARY π
this one comes from the Standard C Library, aka libc, and you link it with -lc. so iconic. β¨
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/linker.h>
int
kldfirstmod(int fileid);
π DESCRIPTION π
so kldfirstmod() is a system call. it returns the module id pertaining to the first module referenced by fileid. that's the whole vibe. if fileid points at a kld file, you get the id of the first module it references. π
π«Ά RETURN VALUES π«Ά
kldfirstmod() will return the id of the first module referenced by fileid, or 0 if there are no references. so if it's empty, you get a lil 0. no references, no drama. π
π ERRORS π
[ENOENT]β the kld file referenced byfileidwas not found. literally not there. poof. π
π SEE ALSO π
kldfind(2)kldload(2)kldnext(2)kldstat(2)kldsym(2)kldunload(2)modfind(2)modfnext(2)modnext(2)modstat(2)kld(4)kldstat(8)
π HISTORY π
the kld interface first appeared in FreeBSD 3.0. history was made. π
mwah π this page is from Debian, dated March 3, 1999, and it's KLDFIRSTMOD(2). bye bestie! π«Ά
π¦ 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