fputws(3)
β¨ fputws(3) β¨
okay bestie, gather round, because today we're talking about fputws β a lil libc function from the Library Functions Manual and honestly? she's iconic in her own quiet way. π
πΈ NAME πΈ
fputws β write a wide-character string to a FILE stream
π LIBRARY π
Standard C library (libc, -lc). yes, the classic. the og. π
π¦ SYNOPSIS π¦
#include <wchar.h>
int fputws(const wchar_t *restrict ws, FILE *restrict stream);
β¨ DESCRIPTION β¨
so. fputws() is literally the wide-character equivalent of fputs(3). like, same energy, wider chars. π«Ά
what she does: she writes the wide-character string that starts at ws β going up to but not including that terminating null wide character (L'\0') β straight into stream. no cap, that's the whole gig.
and if you want a nonlocking counterpart (she's busy, she doesn't do locks)? go check out unlocked_stdio(3). π
π RETURN VALUE π
- she returns a nonnegative integer if everything went great β¨
- or
-1to tell you something went wrong π
that's it. that's the whole vibe check.
π ATTRIBUTES π
(for the whole explanation of what these terms even mean, see attributes(7). go, read, slay.)
- Interface:
fputws() - Attribute: Thread safety
- Value:
MT-Safe
so yes bestie, she is MT-Safe. safe to share with the thread girlies. π₯
π STANDARDS π
C11, POSIX.1-2008. certified. periodt. π
π§ HISTORY π§
POSIX.1-2001, C99. she's been around, she's got lore. π
π NOTES π
- the behavior of
fputws()depends on theLC_CTYPEcategory of the current locale. so like, know your locale, bestie. π - if no additional information gets passed to the
fopen(3)call, it's reasonable to expect thatfputws()will actually write the multibyte string corresponding to the wide-character stringws. ngl that's a pretty reasonable expectation to have. π
π SEE ALSO π
and that's the tea, bestie π«Ά this was Linux man-pages version 6.20, dated 2026-02-08 β go forth and write those wide characters, mwah π
β¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms