WCSCPY(3POSIX)
π WCSCPY(3POSIX) β the POSIX Programmer's Manual, bestie edition π
okay so before we even start, real talk about the PROLOG, because it's important and I'm not gonna gatekeep it from you:
This manual page is part of the POSIX Programmer's Manual. 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.
like. it might not even exist on your Linux box. vibe check your system first, bestie. π
β¨ NAME β¨
wcpcpy, wcscpy β copy a wide-character string, returning a pointer to its end π¦
πΈ SYNOPSIS πΈ
#include <wchar.h>
wchar_t *wcpcpy(wchar_t *restrict ws1, const wchar_t *restrict ws2);
wchar_t *wcscpy(wchar_t *restrict ws1, const wchar_t *restrict ws2);
two little icons, same job, slightly different glow-up at the end. iykyk. β¨
π DESCRIPTION π
first up, a note that only applies to wcscpy(): 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. this volume of POSIX.1β2017 defers to the ISO C standard. so like, ISO C is the main character here, fr fr.
now the actual tea β β the wcpcpy() and wcscpy() functions shall copy the wide-character string pointed to by ws2 (including the terminating null wide-character code, not skipping the little guy πΈ) into the array pointed to by ws1.
and this next part is the part where you listen to me, okay? π
- the application shall ensure that there is room for at least
wcslen(ws2)+1wide characters in thews1array. not "probably". at least. count it. - the application shall also ensure that the
ws2andws1arrays do not overlap. like, personal space, bestie. respect it.
π¨ If copying takes place between objects that overlap, the behavior is undefined. that's not a vibe, that's chaos. don't do it. π
π₯ RETURN VALUE π₯
- the
wcpcpy()function shall return a pointer to the terminating null wide-character code copied into thews1buffer. yes, it points at the end, it's giving "i'll walk you to the door" energy. πͺβ¨ - the
wcscpy()function shall returnws1. simple. iconic. the original. π
and, crucially: No return values are reserved to indicate an error. so if you were waiting for a lil error code to come save youβ¦ she's not coming. π
π«Ά ERRORS π«Ά
No errors are defined.
the following sections are informative. (translation: the vibes are informational only, the requirements were up top π )
π EXAMPLES π
None. literally nothing. empty. a clean slate. we move. π§
β APPLICATION USAGE β
None. also nothing. not me having nothing to say for once π
π RATIONALE π
None. no thoughts, head empty, just standards. π
π¦ FUTURE DIRECTIONS π¦
None. the future is a mystery and she's not telling. β¨
π SEE ALSO π
strcpy()wcsdup()wcsncpy()
and also: the Base Definitions volume of POSIX.1β2017, <wchar.h> πΈ
π COPYRIGHT π
okay this part is the legal bit and I'm keeping it exactly, no editing, because lawyers are the one audience you do not play with:
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 comes to you from IEEE/The Open Group, dated 2017, and it lives under the name WCSCPY(3POSIX). go copy some wide strings responsibly, and remember: wcslen(ws2)+1. count it. periodt. π
β¨
π¦ 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