LOADFIRMWARE(9)

πŸ“¦ in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

loadfirmware β€” load a firmware file from the filesystem

Hiii bestie πŸ’– welcome to LOADFIRMWARE(9), straight outta the Kernel Developer's Manual. This one is literally about loading a firmware file from the filesystem, and it's giving "small function, important job" energy ✨


✨ SYNOPSIS ✨

#include <sys/device.h>

int
loadfirmware(const char *filename, u_char **buf, size_t *buflen);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so loadfirmware() loads a firmware from the file specified by filename, and it looks in the directory /etc/firmware πŸ‘€βœ¨

Memory for the firmware is allocated using malloc(9) with type M_DEVBUF as need be, within a reasonable size limit. No cap, that's the whole vibe.

If it's no longer needed, the firmware buffer buf can be freed using free(9) with type M_DEVBUF πŸ§šπŸ’œ


🌸 RETURN VALUES 🌸

If successful, buf is set to point to the allocation and buflen is set to the size of the firmware. Then loadfirmware() returns 0 β€” iconic, we love a zero return πŸ’…βœ¨

Otherwise, it returns an errno style error. Not slay, but useful 😭


πŸ’Œ cute little sign-off: this page is from Debian, dated June 4, 2013 β€” stay slay, bestie 🫢🌈

πŸ“¦ where this page comes from