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 by fileid was not found. literally not there. poof. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘


🌈 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