strlcpy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ strlcpy(9) β€” Kernel API Manual, bestie! πŸŽ€

Okay so this is the kernel API manual page for strlcpy(9) and we’re gonna make it make sense, no cap. ✨

πŸ’– NAME πŸ’–

strlcpy β€” Copy a C-string into a sized buffer. Literally what it says on the tin: it copies a C-string into a buffer that has a size. 🫢

✨ SYNOPSIS ✨

size_t strlcpy (char *dest , const char *src , size_t size );

🌸 ARGUMENTS 🌸

  • dest β€” Where to copy the string to. The destination. The place the copy lands. πŸ“₯
  • src β€” Where to copy the string from. The source. The original string. πŸ“€
  • size β€” size of destination buffer. Yes, exactly that: the size of the destination buffer. πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

Compatible with *BSD: the result is always a valid NUL-terminated string that fits in the buffer (unless, of course, the buffer size is zero). So like, it’s giving β€œalways a valid NUL-terminated string that fits” energy β€” with one giant exception: buffer size zero. πŸ’€

It does not pad out the result like strncpy does. No extra filler, no padding drama. Periodt. ✨

If libc has strlcpy then that version will override this implementation: πŸ‘‘ no cap, libc’s version takes over.

🌈 SEE ALSO 🌈


Cute little sign-off, bestie: this page’s source/version is ./tools/lib 🌸, dated October 2026 πŸŽ€, and it’s the strlcpy(9) page. Slay. πŸ’…

πŸ“¦ where this page comes from