KLDFIND(2)

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

πŸŽ€ NAME πŸŽ€

okay so this is the KLDFIND(2) page from the System Calls Manual, and the main character is kldfind β€” it returns the fileid of a kld file. that's the whole vibe. πŸ’…

🌸 LIBRARY 🌸

it lives in the Standard C Library (libc, -lc). slay. ✨

✨ SYNOPSIS ✨

#include <sys/linker.h>

int
kldfind(const char *file);

πŸ¦‹ DESCRIPTION πŸ¦‹

bestie, the kldfind() system call returns the fileid of the kld file referenced by file. literally that's it β€” it's giving β€œlook up the id, no extra drama”. 🫢

⭐ RETURN VALUES ⭐

kldfind() returns the fileid of the kld file referenced by file. upon error, kldfind() returns -1 and sets errno to indicate the error. periodt. 😭

πŸ’€ ERRORS πŸ’€

errno is set to the following if kldfind() fails:

  • EFAULT β€” The data required for this operation could not be read from the kernel space.
  • ENOENT β€” The file specified is not loaded in the kernel.
no cap, ENOENT is the β€œbestie, that file isn't loaded in the kernel” error. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

go bother these other pages when you're done:

πŸ‘‘ HISTORY πŸ‘‘

the kld interface first appeared in FreeBSD 3.0. iconic behavior. 🌈


mwah πŸ’‹ β€” this page is from Debian, dated March 3, 1999, and it's the KLDFIND(2) page. go off, bestie. πŸŽ€βœ¨

πŸ“¦ where this page comes from