From 655ee2825121e149a9976e562946892efb20aea1 Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 7 Apr 2005 21:48:47 +0000 Subject: *** empty log message *** --- runtime/copy.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'runtime/copy.c') diff --git a/runtime/copy.c b/runtime/copy.c index 6e2313f6..ef5f094d 100644 --- a/runtime/copy.c +++ b/runtime/copy.c @@ -89,6 +89,7 @@ do { \ * * If count is smaller than the length of the string, copies * count bytes and returns count. + * @deprecated I can't think of why you wouldn't use _stp_string_from_user() instead. */ long @@ -99,6 +100,16 @@ _stp_strncpy_from_user(char *dst, const char __user *src, long count) return res; } +/** Copy a String from userspace. + * Copies a string of up to \e count bytes from userspace into a String. + * If access to userspace fails, returns -EFAULT (some data may have been + * copied). + * @param str Destination String. + * @param src Source address, in user space. + * @param count Maximum number of bytes to copy, including the trailing NULL. + * + */ + void _stp_string_from_user (String str, const char __user *src, long count) { long res; @@ -124,7 +135,7 @@ void _stp_string_from_user (String str, const char __user *src, long count) * */ -unsigned long inline +unsigned long _stp_copy_from_user (char *dst, const char __user *src, unsigned long count) { return __copy_from_user_inatomic(dst, src, count); -- cgit