RESOURCE_INT_VALUE(9)

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

πŸŽ€ RESOURCE_INT_VALUE(9) πŸŽ€

okay so bestie, this page comes from the Kernel Developer's Manual, and it's literally the group-chat guide to pulling values out of the hints mechanism. no cap, kernel-dev energy only. πŸ’…


✨ NAME ✨

resource_int_value, resource_long_value, resource_string_value β€” get a value from the hints mechanism. periodt. 🫢


🌸 SYNOPSIS 🌸

copy these includes and signatures exactly, bestie β€” character for character, no autocorrect nonsense:

#include <sys/param.h>
#include <sys/bus.h>

int
resource_int_value(const char *name, int unit, const char *resname,
    int *result);

int
resource_long_value(const char *name, int unit, const char *resname,
    long *result);

int
resource_string_value(const char *name, int unit, const char *resname,
    const char **result);

πŸ¦‹ DESCRIPTION πŸ¦‹

These functions fetch a value from the hints mechanism. that's the whole assignment, and these three are the ones who pull it off. πŸ’–

The functions take the following arguments:

  • name β€” the name of the device to get the resource value from.
  • unit β€” the unit number of the device. -1 is special and is used for wildcard entries.
  • resname β€” the resource name.
  • result β€” a pointer to memory in which to store the resource value.

πŸ‘‘ RETURN VALUES πŸ‘‘

If successful, the functions return 0. Otherwise, a non-zero error code is returned. so 0 is the slay result, and non-zero means something didn't pass the vibe check. 😭


πŸ’€ ERRORS πŸ’€

The functions will fail if:

  • [ENOENT] β€” the resource could not be found. literally not in the chat. πŸ™ˆ
  • [EFTYPE] β€” Inappropriate resource type. wrong-vibe resource, bestie. πŸ’€

🌈 SEE ALSO 🌈

go read these too, bestie. πŸ“š


πŸ“ AUTHORS πŸ“

This manual page was written by Warner Losh <imp@FreeBSD.org>. shoutout to the icon who wrote it. πŸ‘‘

mwah πŸ’‹ xoxo, this page is from the Debian edition, dated March 1, 2001, and it's filed under RESOURCE_INT_VALUE(9). byeee πŸ¦‹

πŸ“¦ where this page comes from