Page MenuHomeFreeBSD

LinuxKPI: Implement strscpy
ClosedPublic

Authored by wulf on Jul 2 2021, 11:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 26, 10:15 AM
Unknown Object (File)
Fri, Dec 5, 8:47 PM
Unknown Object (File)
Thu, Dec 4, 3:07 AM
Unknown Object (File)
Nov 24 2025, 8:16 PM
Unknown Object (File)
Nov 21 2025, 7:01 PM
Unknown Object (File)
Nov 11 2025, 11:30 PM
Unknown Object (File)
Nov 7 2025, 3:34 AM
Unknown Object (File)
Oct 23 2025, 4:40 PM

Details

Summary

strscpy copies the src string, or as much of it as fits, into the dst
buffer. The dst buffer is always NUL terminated, unless it's zero-sized.
strscpy returns the number of characters copied (not including the
trailing NUL) or -E2BIG if len is 0 or src was truncated.

Currently drm-kmod replaces strscpy with strncpy that is not quite
correct as strncpy does not NUL-terminate overflown strings and returns
different values on exit.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40247
Build 37136: arc lint + arc unit