From 2c5df0dfeaf878f0f09485b7a80c79aea36d194e Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 10 Oct 2025 19:41:53 -0400 Subject: kern: systm: Add copyoutstr() Signed-off-by: Ian Moffett --- src/sys/include/os/systm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/sys/include') diff --git a/src/sys/include/os/systm.h b/src/sys/include/os/systm.h index 24f21db..4cb526e 100644 --- a/src/sys/include/os/systm.h +++ b/src/sys/include/os/systm.h @@ -68,4 +68,16 @@ int copyin(const void *uaddr, void *kaddr, size_t len); */ int copyout(const void *kaddr, void *uaddr, size_t len); +/* + * Copy kernel string to userland safely + * + * @kaddr: Kernel space address to copy from + * @uaddr: User space address to copy to + * @len: Length of bytes to copy + * + * Returns zero on success, otherwise a less than + * zero value. + */ +int copyoutstr(const void *kaddr, void *addr, size_t len); + #endif /* !_OS_SYSTM_H_ */ -- cgit v1.2.3