diff options
author | hunt <hunt> | 2005-04-07 15:17:29 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-04-07 15:17:29 +0000 |
commit | 3d4bc8bea6b45893bd4b49f44df26bd602b4cba5 (patch) | |
tree | bae3fb1bc5fcbd7906574b6902c649b203274a3f /runtime/copy.c | |
parent | 6e01db401be4a19e6d81d9955d055e2f4e1b6aea (diff) | |
download | systemtap-steved-3d4bc8bea6b45893bd4b49f44df26bd602b4cba5.tar.gz systemtap-steved-3d4bc8bea6b45893bd4b49f44df26bd602b4cba5.tar.xz systemtap-steved-3d4bc8bea6b45893bd4b49f44df26bd602b4cba5.zip |
Update to use relayfs.
Diffstat (limited to 'runtime/copy.c')
-rw-r--r-- | runtime/copy.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/runtime/copy.c b/runtime/copy.c index f4b35106..6e2313f6 100644 --- a/runtime/copy.c +++ b/runtime/copy.c @@ -1,7 +1,8 @@ -#ifndef _COPY_C_ +#ifndef _COPY_C_ /* -*- linux-c -*- */ #define _COPY_C_ -/* -*- linux-c -*- */ +#include "string.c" + /** @file copy.c * @brief Functions to copy from user space. */ @@ -98,6 +99,18 @@ _stp_strncpy_from_user(char *dst, const char __user *src, long count) return res; } +void _stp_string_from_user (String str, const char __user *src, long count) +{ + long res; + if (count > STP_STRING_SIZE - str->len - 1) + count = STP_STRING_SIZE - str->len - 1; + __stp_strncpy_from_user(str->buf + str->len, src, count, res); + if (res > 0) { + str->len += res; + str->buf[str->len] = '\0'; + } +} + /** Copy a block of data from user space. * * If some data could not be copied, this function will pad the copied |