MEMSET(3P)

πŸ’– MEMSET(3P) πŸ’–

okay bestie, gather round, because today we're talking about memset from the POSIX Programmer's Manual, and honestly? she's iconic, she's simple, she's the moment. πŸŽ€


🌸 PROLOG 🌸

so real talk first: this manual page is part of the POSIX Programmer's Manual. that's her home. 🏠

but heads up β€” the Linux implementation of this interface may differ (so if you're on Linux, go consult the corresponding Linux manual page for the details, fr fr), and it's also possible the interface isn't implemented on Linux at all. not trying to scare you, just keeping it 100. πŸ’…


✨ NAME ✨

memset β€” set bytes in memory 🫢


🌈 SYNOPSIS 🌈

#include <string.h>

void *memset(void *s, int c, size_t n);

πŸ’œ DESCRIPTION πŸ’œ

the functionality described on this reference page is aligned with the ISO C standard. and like, if there's any conflict between what's written here and the ISO C standard? that's unintentional, nobody's fighting. this volume of POSIX.1‐2017 defers to the ISO C standard, periodt. πŸ‘‘

so what does memset() actually do? she shall copy c (converted to an unsigned char) into each of the first n bytes of the object pointed to by s. that's it. that's the whole job. filling bytes with a value, no notes. ✨


πŸ¦‹ RETURN VALUE πŸ¦‹

memset() shall return s. that's the return value. and lowkey important: no return value is reserved to indicate an error β€” so don't go looking for one, bestie, there isn't one. 😌


πŸ’€ ERRORS πŸ’€

no errors are defined. she simply doesn't do that. πŸ™ˆ

the following sections are informative β€” meaning they're the vibes section, not the rules section. 🧚


πŸŽ€ EXAMPLES πŸŽ€

None.

(yeah. nothing. she's self-explanatory, your honor. πŸ’…)


πŸ“ APPLICATION USAGE πŸ“

None.


⭐ RATIONALE ⭐

None.


🌈 FUTURE DIRECTIONS 🌈

None.


πŸ‘‘ SEE ALSO πŸ‘‘

the Base Definitions volume of POSIX.1‐2017, <string.h> 🌸


okay this part is the serious legal bit and we're keeping every word of it, no cap:

portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.

in the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. πŸ‘‘ the original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


not me ending on the legal section, but we gotta respect the paperwork bestie πŸ’–

and that's the whole page!! this one came from IEEE/The Open Group, dated 2017, and it's filed under MEMSET(3P). slay, bye!! πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from