WMEMSET(3POSIX)
π WMEMSET(3POSIX) π
okay bestie, welcome to the POSIX Programmer's Manual β this is the wmemset(3POSIX) page, from the volume that shipped in 2017. pull up a chair, grab a boba, we're doing wide characters today π§β¨
πΈ PROLOG πΈ
Real talk first, because it matters: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β so if you're actually on Linux, go read the corresponding Linux manual page for the real tea on Linux behavior. OR the interface might just not be implemented on Linux at all π. Either way, vibe check your platform first, iykyk.
β¨ NAME β¨
wmemset β set wide characters in memory π
π SYNOPSIS π
#include <wchar.h>
wchar_t *wmemset(wchar_t *ws, wchar_t wc, size_t n);
π¦ DESCRIPTION π¦
So the functionality on this reference page is aligned with the ISO C standard. If there's any conflict between what's written here and the ISO C standard, that conflict is unintentional β and this volume of POSIX.1β2017 defers to the ISO C standard. The C standard is the referee, periodt.
Now the actual function, bestie. wmemset() shall copy the value of wc into each of the first n wide characters of the object pointed to by ws. That's it, that's the whole job π
And here's the iconic part: this function shall not be affected by locale, and all wchar_t values shall be treated identically. The null wide character? Not special. wchar_t values that don't correspond to valid characters? Also not special. No favorites here, everyone gets the same treatment. It's giving egalitarian π
One little edge case, so listen up: if n is zero, the application shall ensure that ws is a valid pointer β yes, even though nothing gets written, ws still has to be legit β and the function shall copy zero wide characters. Zero. Nothing. Empty. Nada. But the pointer still gotta be valid, no cap.
π₯ RETURN VALUE π₯
The wmemset() functions shall return the value of ws. That's your pointer, back in your hands, same one you gave it. π«Ά
π ERRORS π
No errors are defined. Literally none. It's a no-drama function.
The following sections are informative.
π EXAMPLES π
None.
π APPLICATION USAGE π
None.
β RATIONALE β
None.
π§ FUTURE DIRECTIONS π§
None.
π SEE ALSO π
wmemchr()wmemcmp()wmemcpy()wmemmove()
Also, from the Base Definitions volume of POSIX.1β2017: <wchar.h> π
π COPYRIGHT π
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 .
okay that's the whole page, bestie, you ate it πβ¨ this was the IEEE/The Open Group 2017 edition of WMEMSET(3POSIX) β go forth and memset those wide chars, mwah π
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms