UFETCH(9)
π UFETCH(9) β kernel developer's manual, but make it cute β¨
okay so bestie, welcome to UFETCH(9) π
this is a section 9 page (kernel developer's manual territory), and it's all about the ufetch family β a whole lil squad of functions whose entire job is grabbing one single memory cell's worth of data out of user-space and handing it over to the kernel π«Ά
πΈ NAME πΈ
ufetch, ufetch_8, ufetch_16, ufetch_32, ufetch_64, ufetch_char, ufetch_short, ufetch_int, ufetch_long, ufetch_ptr β fetch data from user-space, literally their whole personality π«
π SYNOPSIS π
#include <sys/systm.h>
int
ufetch_8(const uint8_t *uaddr, uint8_t *valp);
int
ufetch_16(const uint16_t *uaddr, uint16_t *valp);
int
ufetch_32(const uint32_t *uaddr, uint32_t *valp);
int
ufetch_64(const uint64_t *uaddr, uint64_t *valp);
int
ufetch_char(const unsigned char *uaddr, unsigned char *valp);
int
ufetch_short(const unsigned short *uaddr, unsigned short *valp);
int
ufetch_int(const unsigned int *uaddr, unsigned int *valp);
int
ufetch_long(const unsigned long *uaddr, unsigned long *valp);
int
ufetch_ptr(const void **uaddr, void **valp);
like, yes, that's a lot of variants β they're all the same vibe, just different widths, iykyk π
π¦ DESCRIPTION π¦
so the ufetch functions are your go-to for fetching the value of a single memory cell from user-space π― like, one cell, no more, no less, main character behavior.
in every single case: the value referenced by the user-space address uaddr gets retrieved, and then it's stored at the kernel memory location referenced by valp. that's the whole plot π
β heads up bestie:ufetch_64is only available on systems employing theLP64memory model. you can check for that by testing for the presence of the_LP64C preprocessor macro β no cap, that's how you know π
π§ RETURN VALUES π§
the ufetch functions return 0 on success, and an error number on failure. simple as that, periodt β¨
π SEE ALSO π
go read those too, they're the friend group π
and that's the whole page, bestie!! ππβ¨
this lil icon came from the Debian edition of the manual, dated March 18, 2019 β shoutout to whoever wrote it, you ate ππ ngl this page was short and sweet and I'm obsessed π«Άπ
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2019 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms