ucs2_strscpy(9)
π ucs2_strscpy β the Kernel API Manual, bestie edition π
okay so this one's from the Kernel API Manual, section 9, and it's literally the cutest little string copier you've ever met π₯° it's called ucs2_strscpy and we're gonna get into it.
πΈ NAME πΈ
ucs2_strscpy β copy a UCS2 string into a sized buffer. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
ssize_t ucs2_strscpy (ucs2_char_t *dst , const ucs2_char_t *src , size_t
count );
like, that's the whole signature, written out exactly as it lives π«Ά
π ARGUMENTS π
dstβ pointer to the destination buffer, aka where we're copying the string to. this is the glow-up location πsrcβ pointer to the source buffer, aka where we're copying the string from. the original, the blueprint, the main character πcountβ size of the destination buffer, measured in UCS2 (16-bit) characters. yes bestie, UCS2 characters, not bytes, don't get it twisted πΈ
π¦ DESCRIPTION π¦
so it's like strscpy, only for UCS2 strings. periodt. π
it copies the source string src, or as much of it as actually fits, into the destination buffer dst. ngl, if the string buffers overlap, the behavior is undefined β so like, don't do that, that's not the vibe π
the destination buffer dst is always NUL-terminated, unless it's zero-sized. zero-sized buffers get nothing, which honestly? fair. π«Ά
π₯ RETURN π₯
it hands you back the number of characters copied into dst β and that's excluding the trailing NUL terminator, don't count the NUL bestie β or -E2BIG if count is 0 or if src got truncated because the destination buffer was too small. π tiny buffer energy.
π SEE ALSO π
- Kernel file
./lib/ucs2_string.cβ go look, iykyk β
and that's the page!! this absolutely iconic little manpage came from ./lib, dated October 2026, for ucs2_strscpy(9). slay, ate, no cap ππ§ββοΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms