MEMSET(9)
β¨ 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
- Copyright (c) 1990, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms