diff options
| author | Alice Ryhl <[email protected]> | 2025-06-16 12:41:47 +0000 |
|---|---|---|
| committer | Miguel Ojeda <[email protected]> | 2025-07-13 23:33:26 +0000 |
| commit | 8da881d39c1b7fd4a211587ba40f1c936909a11a (patch) | |
| tree | 1618064ba9968a3ff12bbca8afc13c529247594e /scripts/rustdoc_test_gen.rs | |
| parent | Merge tag 'pin-init-v6.17' of https://github.com/Rust-for-Linux/linux into ru... (diff) | |
| download | kernel-8da881d39c1b7fd4a211587ba40f1c936909a11a.tar.gz kernel-8da881d39c1b7fd4a211587ba40f1c936909a11a.zip | |
rust: uaccess: add strncpy_from_user
This patch adds a direct wrapper around the C function of the same name.
It's not really intended for direct use by Rust code since
strncpy_from_user has a somewhat unfortunate API where it only
nul-terminates the buffer if there's space for the nul-terminator. This
means that a direct Rust wrapper around it could not return a &CStr
since the buffer may not be a cstring. However, we still add the method
to build more convenient APIs on top of it, which will happen in
subsequent patches.
Reviewed-by: Danilo Krummrich <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Boqun Feng <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Signed-off-by: Alice Ryhl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'scripts/rustdoc_test_gen.rs')
0 files changed, 0 insertions, 0 deletions
