WCSCPY(3P)
π WCSCPY(3P) β bestie's guide to the POSIX Programmer's Manual π
okay so this page is WCSCPY(3P), and it lives in the POSIX Programmer's Manual (yes, that whole volume, she's iconic). buckle up bestie, we're copying wide-character strings and we're gonna have fun doing it π¦
πΈ PROLOG πΈ
heads up before we even start: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β so like, consult the corresponding Linux manual page for the deets on Linux behavior β or honestly the interface might not even be implemented on Linux at all. π no cap, check your system.
β¨ NAME β¨
wcpcpy, wcscpy β copy a wide-character string, and return a pointer to its end. it's giving "copy and also tell you where you ended up" π«Ά
π 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);
look at those restrict qualifiers. main character energy fr fr. β¨
π DESCRIPTION π
for wcscpy() specifically: 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 if they ever beef, ISO C wins. periodt.
The wcpcpy() and wcscpy() functions shall copy the wide-character string pointed to by ws2 (including the terminating null wide-character code) into the array pointed to by ws1. like, the whole thing. null terminator included, she comes along for the ride π
The application shall ensure that there is room for at least wcslen(ws2)+1 wide characters in the ws1 array, and that the ws2 and ws1 arrays do not overlap.
β οΈ If copying takes place between objects that overlap, the behavior is undefined. not "kinda weird", not "a little glitchy" β undefined. do not do this. i'm begging. π
π RETURN VALUE π
- The
wcpcpy()function shall return a pointer to the terminating null wide-character code copied into thews1buffer. she points at the end, like "you're done, bestie, here's the finish line" π - The
wcscpy()function shall returnws1. that's it, that's the return value, she just hands you back your own buffer.
No return values are reserved to indicate an error. so like, don't go looking for an error signal in the return value, there isn't one π«
π ERRORS π
No errors are defined.
The following sections are informative. (translation: the rest of this is vibes and context, not requirements β¨)
π EXAMPLES π
None. iconic of her honestly, no example, no notes.
π§ APPLICATION USAGE π§
None. she said "you got this, figure it out" π
β RATIONALE β
None. no reasoning given, it just is. queen behavior.
π₯ FUTURE DIRECTIONS π₯
None. the future is unspecified and honestly? same.
π¦ SEE ALSO π¦
strcpy()wcsdup()wcsncpy()
The Base Definitions volume of POSIX.1β2017, <wchar.h> π
π COPYRIGHT π
okay legal moment, don't skip this, it matters:
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, and the manual page WCSCPY(3P) β go forth, copy your wide-character strings, respect the overlap warning, and slay πβ¨π
π¦ 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