wmempcpy(3)

🌸 wmempcpy(3) β€” wide-character memory return-offset-pointer copy 🌸

okay bestie sit DOWN because we're talking about wmempcpy and she is lowkey iconic for exactly one reason: she doesn't just copy ur wide characters, she tells u where she stopped. that's the whole personality. πŸ’…

Library: Standard C library (libc, -lc) β€” yeah she's in libc, she's official, she's got papers. πŸŽ€


✨ SYNOPSIS ✨

#define _GNU_SOURCE         /* See feature_test_macros(7) */
#include <wchar.h>

wchar_t *wmempcpy(size_t n;
              wchar_t dest[restrict n], const wchar_t src[restrict n],
              size_t n);
🚨 bestie listen: u need that #define _GNU_SOURCE before the #include <wchar.h> or she literally will not show up. (peep feature_test_macros(7) for the whole lore on why feature macros are like that.)

πŸ’– DESCRIPTION πŸ’–

so. wmempcpy() is the wide-character equivalent of mempcpy(3). that's it, that's her whole deal β€” she's mempcpy but for wchar_t instead of plain bytes. πŸ¦‹

and the way to think about it? she's equivalent to this:

wmemcpy(dest, src, n) + n

like, literally. she does the copy, then she hands u back the pointer that's been scooted forward past everything she wrote. no cap. so instead of getting the start of the destination back, u get the end, which means u can just keep appending without doing any pointer math yourself. main character behavior fr fr. πŸ‘‘


🌈 RETURN VALUE 🌈

go check mempcpy(3) for the deets bestie, it's the same energy. ✨


🫢 ATTRIBUTES 🫢

for the whole explanation of what these words even mean, attributes(7) has u covered. πŸ“–

  • Interface: wmempcpy()
  • Attribute: Thread safety
  • Value: MT-Safe
so basically she is MT-Safe β€” multiple threads can vibe with her at the same time and nobody's gonna catch a stray. slay. πŸ’š

πŸ‘‘ STANDARDS πŸ‘‘

GNU. (yes she's a GNU girlie, she's built different, ur portable code might not have her 😭)


πŸŽ€ HISTORY πŸŽ€

she's been here since glibc 2.1. an OG. a legend. respect the elders. 🧚


πŸ”₯ SEE ALSO πŸ”₯

  • mempcpy(3) β€” her byte-sized sibling, go say hi

and that's the whole page bestie, u ate it, u understood it, we love to see it. πŸ’œ

this lil love letter came from Linux man-pages 6.20, dated 2026-08-10 β€” periodt. 🌸✨

πŸ“¦ 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-1.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms