summaryrefslogtreecommitdiffstats
path: root/runtime/copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/copy.c')
-rw-r--r--runtime/copy.c13
1 files changed, 12 insertions, 1 deletions
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 <i>count</i> is smaller than the length of the string, copies
* <i>count</i> bytes and returns <i>count</i>.
+ * @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);