GETBOOTFILE(3)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸŽ€ GETBOOTFILE(3) πŸŽ€

okay so this is a Library Functions Manual page, bestie β€” it's giving β€œwhere did my kernel even come from?” energy, and the answer is a whole function. no cap. πŸ’–


🌸 NAME 🌸

getbootfile β€” get kernel boot file name

πŸ“š LIBRARY πŸ“š

Standard C Library (libc, -lc) β€” the classic libc girlies, periodt. 🫢

🧚 SYNOPSIS 🧚

#include <paths.h>

const char *
getbootfile(void);

✨ DESCRIPTION ✨

okay so getbootfile() literally retrieves the full pathname of the file from which the current kernel was loaded, and returns a static pointer to the name. main character behavior tbh. πŸ‘‘

and a read/write interface to this information is available via the sysctl(3) MIB variable β€œkern.bootfile”. iykyk. πŸ¦‹

πŸ’… RETURN VALUES πŸ’…

If the call succeeds, a string giving the pathname is returned. slay. ✨

If it fails, a null pointer is returned and an error code is placed in the global location errno. not the vibe, but good to know. 😭

🫢 SEE ALSO 🫢

  • sysctl(3) β€” go read that one too, bestie.

🌈 HISTORY 🌈

The getbootfile() function appeared in FreeBSD 2.0. iconic lineage fr fr. πŸ‘‘

πŸ’€ BUGS πŸ’€

If the boot blocks have not been modified to pass this information into the kernel at boot time, the static string /boot/kernel/kernel is returned instead of the real boot file.

so yeah β€” if the boot blocks aren't doing their little job, you get that static string instead of the real boot file. noted. πŸ™ˆ

source/version: Debian Β· September 23, 1994 β€” byeee bestie, go check your boot file πŸ’…βœ¨

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms