diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-05 19:13:44 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-05 19:13:44 -0400 |
commit | 2e42d32407165f437549abddd319f8feab0051d6 (patch) | |
tree | f123df6adff5b8dfa01e82e0141f413461ffc05e /src/sys/include | |
parent | b7ed37d5af4bdf78f2fbed4af896e9956bc85168 (diff) |
kern: os: Add copyinstr()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include')
-rw-r--r-- | src/sys/include/os/systm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sys/include/os/systm.h b/src/sys/include/os/systm.h index 33de08a..24f21db 100644 --- a/src/sys/include/os/systm.h +++ b/src/sys/include/os/systm.h @@ -33,6 +33,18 @@ #include <sys/types.h> /* + * Copy userland string to kernel space safely + * + * @uaddr: Userspace source address to copy from + * @kaddr: Kernel address dest address to copy to + * @len: Length of buffer + * + * Returns 0 on success, otherwise a less than zero value + * on failure. + */ +int copyinstr(const void *uaddr, char *kaddr, size_t len); + +/* * Copy userland data to kernel space safely * * @uaddr: Userspace source address to copy from |