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 -1 to 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 the LC_CTYPE category 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 that fputws() will actually write the multibyte string corresponding to the wide-character string ws. 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