From b9c556e44326b40b2c927a0a5b5626332a8c9587 Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 22 Mar 2005 08:57:11 +0000 Subject: *** empty log message *** --- runtime/docs/html/copy_8c-source.html | 80 +++++++++++++++++++++++++---------- 1 file changed, 58 insertions(+), 22 deletions(-) (limited to 'runtime/docs/html/copy_8c-source.html') diff --git a/runtime/docs/html/copy_8c-source.html b/runtime/docs/html/copy_8c-source.html index 3d70030b..bab47938 100644 --- a/runtime/docs/html/copy_8c-source.html +++ b/runtime/docs/html/copy_8c-source.html @@ -1,12 +1,11 @@ -SystemTap: SystemTap Runtime Library +SystemTap: copy.c Source File -
Intro | Functions | Defines | Enumerations | Enumeration Values
- -

copy.c

Go to the documentation of this file.
00001 long _stp_strncpy_from_user(char *dst, const char __user *src, long count);
+
+

copy.c

00001 long _stp_strncpy_from_user(char *dst, const char __user *src, long count);
 00002 //static long __stp_strncpy_from_user(char *dst, const char __user *src, long count);
 00003 
 00004 #if defined (__i386__)
@@ -66,22 +65,61 @@
 00058                 : "memory");                                               \
 00059 } while (0)
 00060 #endif
-00061 
+00061 
+00062 /** Copy a NULL-terminated string from userspace.
+00063  * On success, returns the length of the string (not including the trailing
+00064  * NULL).
+00065  *
+00066  * If access to userspace fails, returns -EFAULT (some data may have been
+00067  * copied).
+00068  * @param dst Destination address, in kernel space.  This buffer must be at
+00069  *         least <i>count</i> bytes long.
+00070  * @param src Source address, in user space.
+00071  * @param count Maximum number of bytes to copy, including the trailing NULL.
+00072  * 
+00073  * If <i>count</i> is smaller than the length of the string, copies 
+00074  * <i>count</i> bytes and returns <i>count</i>.
+00075  */
+00076 
+00077 
 00078 long
-00079 _stp_strncpy_from_user(char *dst, const char __user *src, long count)
+00079 _stp_strncpy_from_user(char *dst, const char __user *src, long count)
 00080 {
 00081         long res;
 00082         __stp_strncpy_from_user(dst, src, count, res);
 00083         return res;
 00084 }
-00085 
+00085 
+00086 /** Copy a block of data from user space.
+00087  *
+00088  * If some data could not be copied, this function will pad the copied
+00089  * data to the requested size using zero bytes.
+00090 
+00091  * @param dst Destination address, in kernel space.
+00092  * @param src Source address, in user space.
+00093  * @param count Number of bytes to copy.
+00094  * @return number of bytes that could not be copied. On success, 
+00095  * this will be zero.
+00096  *
+00097  */
+00098 
 00099 unsigned long inline
-00100 _stp_copy_from_user (char *dst, const char __user *src, unsigned long count)
+00100 _stp_copy_from_user (char *dst, const char __user *src, unsigned long count)
 00101 {
 00102         return __copy_from_user_inatomic(dst, src, count);
 00103 }
-00104 
-00115 int _stp_copy_argv_from_user (MAP list, char __user *__user *argv)
+00104 
+00105 /** Copy an argv from user space to a List.
+00106  *
+00107  * @param list A list.
+00108  * @param argv Source argv, in user space.
+00109  * @return number of elements in <i>list</i>
+00110  *
+00111  * @b Example:
+00112  * @include argv.c
+00113  */
+00114 
+00115 int _stp_copy_argv_from_user (MAP list, char __user *__user *argv)
 00116 {
 00117         char str[128];
 00118         char __user *vstr;
@@ -90,22 +128,20 @@
 00121         if (argv)
 00122                 argv++;
 00123 
-00124         while (argv != NULL) {
+00124         while (argv != NULL) {
 00125                 if (get_user (vstr, argv))
-00126                         break;
-00127 
-00128                 if (vstr == NULL)
-00129                         break;
+00126                         break;
+00127                 
+00128                 if (vstr == NULL)
+00129                         break;
 00130                 
-00131                 len = _stp_strncpy_from_user(str, vstr, 128);
+00131                 len = _stp_strncpy_from_user(str, vstr, 128);
 00132                 str[len] = 0;
-00133                 _stp_list_add_str (list, str);
+00133                 _stp_list_add_str (list, str);
 00134                 argv++;
 00135         }
-00136         return list->num;
+00136         return list->num;
 00137 }
-

Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  - -doxygen 1.4.1
- +

+Generated on Tue Mar 22 00:32:02 2005 for SystemTap. -- cgit