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_SOURCEbefore the#include <wchar.h>or she literally will not show up. (peepfeature_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
- Copyright 2002, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms