FPUTWS(3P)
π FPUTWS(3P) β POSIX Programmer's Manual π
okay bestie, welcome to FPUTWS(3P), straight out of the POSIX Programmer's Manual β¨ pull up a chair, grab a boba, we're writing wide characters to streams and we're gonna slay while doing it π«Ά
πΈ PROLOG πΈ
okay so real talk before anything else: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β so bestie, go consult the corresponding Linux manual page for the actual deets on Linux behavior. orrrr the interface might just not be implemented on Linux at all π. either way, iykyk.
β¨ NAME β¨
fputws β put a wide-character string on a stream π
π SYNOPSIS π
#include <stdio.h>
#include <wchar.h>
int fputws(const wchar_t *restrict ws, FILE *restrict stream);
look at her. so clean. so iconic. π
π¦ DESCRIPTION π¦
okay so first thing's first: the functionality on this reference page is aligned with the ISO C standard. If there's any conflict between what's described here and the ISO C standard, that conflict is unintentional, no cap. This volume of POSIX.1β2017 defers to the ISO C standard, periodt.
so what does fputws() actually do, you ask? it shall write a character string corresponding to the (null-terminated) wide-character string pointed to by ws to the stream pointed to by stream. π
and here's the lil detail that matters: no character corresponding to the terminating null wide-character code shall be written. the null stays home. she does not come to the party. π
also, the last data modification and last file status change timestamps of the file shall be marked for update between the successful execution of fputws() and the next successful completion of a call to fflush() or fclose() on the same stream, or a call to exit() or abort(). timestamps stay booked and busy β°β¨
π RETURN VALUE π
upon successful completion, fputws() shall return a non-negative number. slay.
otherwise? it shall return -1, set an error indicator for the stream, and set errno to indicate the error. not the vibe. π
π₯ ERRORS π₯
refer to fputwc(). that's it, that's the section, she's passing the aux cord π§
the following sections are informative β meaning they're the chill, extra-context part, not the requirements part π§
π EXAMPLES π
None.
(genuinely nothing. an empty plate. not a single crumb π½οΈ)
β APPLICATION USAGE β
okay important thing: the fputws() function does not append a <newline>. it does not do that. it will not do that. stop asking her to do that π
now, this volume of POSIX.1β2017 requires that successful completion simply return a non-negative integer. sounds easy, right? well. there are at least three known different implementation conventions for this requirement:
- Return a constant value.
- Return the last character written.
- Return the number of bytes written. Note that this implementation convention cannot be adhered to for strings longer than
{INT_MAX}bytes, because the value would not be representable in the return type of the function. For backwards-compatibility, implementations can return the number of bytes for strings of up to{INT_MAX}bytes, and return{INT_MAX}for all longer strings.
so yeah, bestie, the return value is giving "mystery box" π β non-negative is all you're promised, fr fr.
π RATIONALE π
None.
(she has no notes. she is at peace. β¨)
π«Ά FUTURE DIRECTIONS π«Ά
None.
(the future is bright and also empty. no notes. πΈ)
π SEE ALSO π
- Section 2.5, Standard I/O Streams,
fopen() - The Base Definitions volume of POSIX.1β2017,
<stdio.h>,<wchar.h>
go read those, bestie, they're the friend group π―
π 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 .
and that's the whole page, bestie!! π this lil masterpiece was brought to you by IEEE/The Open Group, 2017 β aka the FPUTWS(3P) footer legends themselves πβ¨ go forth and write those wide characters, you main character π¦ππ
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- 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-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms