RESOURCE_INT_VALUE(9)
π RESOURCE_INT_VALUE β the kernel dev manual, bestie edition π
okay so you're poking around section 9 of the Kernel Developer's Manual and you found resource_int_value, resource_long_value, and resource_string_value?? slay, you're literally in the kernel right now. let's get into it π«Ά
β¨ NAME β¨
resource_int_value, resource_long_value, resource_string_value β get a value from the hints mechanism
no cap, that's the whole job. they fetch. you receive. π
πΈ SYNOPSIS πΈ
#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);
three little functions, three little vibes: one does int, one does long, one does string. pick your fighter. β
π DESCRIPTION π
so the way that these functions work is they fetch a value from the "hints" mechanism. that's it, that's the plot. π¦
and here's the cast of arguments, one by one:
nameβ the name of the device you're getting the resource value from. the main character, honestly. πunitβ the unit number of the device. and listen,-1is special: it's the wildcard entry. so-1isn't a normal number here, it's a whole mood. πresnameβ the resource name. the thing you're asking about. πresultβ a pointer to memory where the resource value gets stored. yes bestie, you have to hand it somewhere to live. π
π« RETURN VALUES π«
if it worked? 0. iconic. β¨
if it did not work? a non-zero error code comes back at you. not iconic, but informative. π
π ERRORS π
these functions will fail if:
[ENOENT]β the resource could not be found. it's giving lost in the sauce. π[EFTYPE]β inappropriate resource type. wrong vibe, wrong type, hard no. π
π₯ SEE ALSO π₯
go read those too, iykyk. π§
π AUTHORS π
this manual page was written by Warner Losh <imp@FreeBSD.org>. legend behaviour, honestly. π
and that's the whole page, bestie!! it's from the Debian flavour of things, dated March 1, 2001 β so yes, this lore is vintage, and it still ate. periodt. πππΈ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2001 M. Warner Losh
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms