MEMSET(9)

πŸ“¦
version 11.0 Β· 2 versions
, in nixpkgs unstable

✨ MEMSET(9) ✨

okay bestie, welcome to the Kernel Developer's Manual πŸ’… we're doing kernel-flavored memset today β€” yes, the same one you already know and love, but the kernel version, so act accordingly 🫢


🌸 NAME 🌸

memset β€” write a byte to byte string. that's it. that's the whole job. she fills things. she's an icon πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <sys/systm.h>

void *
memset(void *b, int c, size_t len);

look at her. three args, one pointer return, zero drama. no cap πŸ’–


πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea: memset() writes len bytes of value c β€” and yes, c gets converted to an unsigned char, so it's giving very much "int in, byte out" energy β€” into the string b. literally just smearing one single byte value across len of them. repetitive? maybe. effective? absolutely πŸ”₯

like, you pick a byte, you pick how many, and she handles the rest. simple as that, bestie 🧚


πŸ’œ RETURN VALUES πŸ’œ

memset() returns the original value of b. not a new pointer, not a status code, not a surprise β€” the OG b, handed right back to you like a bestie returning your hoodie 😭🫢


⭐ STANDARDS ⭐

memset() conforms to ANSI X3.159-1989 (β€œANSI C89”). so she's certified, standardized, and ancient in the best way possible β€” lowkey a legend πŸ‘‘


ngl, if you're in kernel land and you need a buffer filled with one repeated byte, she's your girl. no notes πŸ’€βœ¨

and that's the whole page, bestie πŸ“ β€” this little gem comes from the Debian edition of the Kernel Developer's Manual, dated July 7, 2001, so shoutout to the elders for keeping memset(9) looking this good for this long πŸŒˆπŸ’– periodt.

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