FPUTWS(3POSIX)
π FPUTWS(3POSIX) π
okay bestie, welcome to the POSIX Programmer's Manual β this page is literally FPUTWS(3POSIX) and it's giving wide characters, but make it a stream πβ¨
πΈ PROLOG πΈ
so like, this manual page is part of the POSIX Programmer's Manual. but heads up bestie:
the Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. π
no cap, sometimes Linux just doesn't have it. vibe check accordingly.
β¨ 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);
that's it. that's the whole signature. restrict on both args, periodt π
π DESCRIPTION π
so the functionality described on this reference page is aligned with the ISO C standard. any conflict between the requirements described here and the ISO C standard is unintentional β like, not on purpose, fr fr. this volume of POSIX.1β2017 defers to the ISO C standard.
now the actual tea β: the fputws() function 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 no character corresponding to the terminating null wide-character code shall be written β the null stays home, it does NOT get invited to the stream π«β¨
and the timestamps?? 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(). it's giving delayed gratification π
π RETURN VALUE π
upon successful completion, fputws() shall return a non-negative number π«Ά
otherwise? it shall return -1, set an error indicator for the stream, and set errno to indicate the error. iconic flop behavior π
π ERRORS π
refer to fputwc().
the following sections are informative β meaning they're the lore, not the law π
π EXAMPLES π
None.
literally none. the void. the absence. π
π APPLICATION USAGE π
first things first: the fputws() function does not append a <newline>. you want a newline? you add it yourself, bestie, it's not gonna do it for you π€
this volume of POSIX.1β2017 requires that successful completion simply return a non-negative integer. and the way there are at least three known different implementation conventions for this requirement?? chaotic:
- 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 as 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 basically, don't assume the return value means anything specific beyond "it worked, probably" π it's giving mystery box
π RATIONALE π
None.
(no thoughts, head empty, slaying regardless β¨)
π§ FUTURE DIRECTIONS π§
None.
the future is literally unchanged. we love stability π«Ά
β SEE ALSO β
- Section 2.5, Standard I/O Streams,
fopen() - The Base Definitions volume of POSIX.1β2017,
<stdio.h>,<wchar.h>
iykyk, go read those next πΈ
π COPYRIGHT π
okay legal bestie moment, gotta do this properly:
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!! brought to you by IEEE/The Open Group, 2017 β aka FPUTWS(3POSIX), signing off π
β¨π¦
π¦ 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