summaryrefslogtreecommitdiffstats
path: root/runtime/docs/html/copy_8c-source.html
diff options
context:
space:
mode:
authorhunt <hunt>2005-03-22 08:57:11 +0000
committerhunt <hunt>2005-03-22 08:57:11 +0000
commitb9c556e44326b40b2c927a0a5b5626332a8c9587 (patch)
treed0497c9323dedcb292d353d79fef769fa6fef210 /runtime/docs/html/copy_8c-source.html
parent4a4753cb066f60eb09906a6021997ec280d3fdc5 (diff)
downloadsystemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.tar.gz
systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.tar.xz
systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.zip
*** empty log message ***
Diffstat (limited to 'runtime/docs/html/copy_8c-source.html')
-rw-r--r--runtime/docs/html/copy_8c-source.html80
1 files changed, 58 insertions, 22 deletions
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 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>SystemTap: SystemTap Runtime Library</title>
+<title>SystemTap: copy.c Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
-<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div>
-
<!-- Generated by Doxygen 1.4.1 -->
-<h1>copy.c</h1><a href="copy_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="keywordtype">long</span> <a class="code" href="copy_8c.html#a0">_stp_strncpy_from_user</a>(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count);
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
+<h1>copy.c</h1><div class="fragment"><pre class="fragment">00001 <span class="keywordtype">long</span> _stp_strncpy_from_user(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count);
00002 <span class="comment">//static long __stp_strncpy_from_user(char *dst, const char __user *src, long count);</span>
00003
00004 <span class="preprocessor">#if defined (__i386__)</span>
@@ -66,22 +65,61 @@
00058 <span class="preprocessor"> : "memory"); \</span>
00059 <span class="preprocessor">} while (0)</span>
00060 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
-00061 <span class="preprocessor"></span>
+00061 <span class="preprocessor"></span><span class="comment"></span>
+00062 <span class="comment">/** Copy a NULL-terminated string from userspace.</span>
+00063 <span class="comment"> * On success, returns the length of the string (not including the trailing</span>
+00064 <span class="comment"> * NULL).</span>
+00065 <span class="comment"> *</span>
+00066 <span class="comment"> * If access to userspace fails, returns -EFAULT (some data may have been</span>
+00067 <span class="comment"> * copied).</span>
+00068 <span class="comment"> * @param dst Destination address, in kernel space. This buffer must be at</span>
+00069 <span class="comment"> * least &lt;i&gt;count&lt;/i&gt; bytes long.</span>
+00070 <span class="comment"> * @param src Source address, in user space.</span>
+00071 <span class="comment"> * @param count Maximum number of bytes to copy, including the trailing NULL.</span>
+00072 <span class="comment"> * </span>
+00073 <span class="comment"> * If &lt;i&gt;count&lt;/i&gt; is smaller than the length of the string, copies </span>
+00074 <span class="comment"> * &lt;i&gt;count&lt;/i&gt; bytes and returns &lt;i&gt;count&lt;/i&gt;.</span>
+00075 <span class="comment"> */</span>
+00076
+00077
00078 <span class="keywordtype">long</span>
-<a name="l00079"></a><a class="code" href="copy_8c.html#a0">00079</a> <a class="code" href="copy_8c.html#a0">_stp_strncpy_from_user</a>(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count)
+00079 _stp_strncpy_from_user(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">long</span> count)
00080 {
00081 <span class="keywordtype">long</span> res;
00082 __stp_strncpy_from_user(dst, src, count, res);
00083 <span class="keywordflow">return</span> res;
00084 }
-00085
+00085 <span class="comment"></span>
+00086 <span class="comment">/** Copy a block of data from user space.</span>
+00087 <span class="comment"> *</span>
+00088 <span class="comment"> * If some data could not be copied, this function will pad the copied</span>
+00089 <span class="comment"> * data to the requested size using zero bytes.</span>
+00090 <span class="comment"></span>
+00091 <span class="comment"> * @param dst Destination address, in kernel space.</span>
+00092 <span class="comment"> * @param src Source address, in user space.</span>
+00093 <span class="comment"> * @param count Number of bytes to copy.</span>
+00094 <span class="comment"> * @return number of bytes that could not be copied. On success, </span>
+00095 <span class="comment"> * this will be zero.</span>
+00096 <span class="comment"> *</span>
+00097 <span class="comment"> */</span>
+00098
00099 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keyword">inline</span>
-<a name="l00100"></a><a class="code" href="copy_8c.html#a1">00100</a> <a class="code" href="copy_8c.html#a1">_stp_copy_from_user</a> (<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> count)
+00100 _stp_copy_from_user (<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> __user *src, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> count)
00101 {
00102 <span class="keywordflow">return</span> __copy_from_user_inatomic(dst, src, count);
00103 }
-00104
-<a name="l00115"></a><a class="code" href="copy_8c.html#a2">00115</a> <span class="keywordtype">int</span> <a class="code" href="copy_8c.html#a2">_stp_copy_argv_from_user</a> (<a class="code" href="structmap__root.html">MAP</a> list, <span class="keywordtype">char</span> __user *__user *argv)
+00104 <span class="comment"></span>
+00105 <span class="comment">/** Copy an argv from user space to a List.</span>
+00106 <span class="comment"> *</span>
+00107 <span class="comment"> * @param list A list.</span>
+00108 <span class="comment"> * @param argv Source argv, in user space.</span>
+00109 <span class="comment"> * @return number of elements in &lt;i&gt;list&lt;/i&gt;</span>
+00110 <span class="comment"> *</span>
+00111 <span class="comment"> * @b Example:</span>
+00112 <span class="comment"> * @include argv.c</span>
+00113 <span class="comment"> */</span>
+00114
+00115 <span class="keywordtype">int</span> _stp_copy_argv_from_user (<a class="code" href="structmap__root.html">MAP</a> list, <span class="keywordtype">char</span> __user *__user *argv)
00116 {
00117 <span class="keywordtype">char</span> str[128];
00118 <span class="keywordtype">char</span> __user *vstr;
@@ -90,22 +128,20 @@
00121 <span class="keywordflow">if</span> (argv)
00122 argv++;
00123
-00124 <span class="keywordflow">while</span> (argv != NULL) {
+00124 while (argv != NULL) {
00125 <span class="keywordflow">if</span> (get_user (vstr, argv))
-00126 <span class="keywordflow">break</span>;
-00127
-00128 <span class="keywordflow">if</span> (vstr == NULL)
-00129 <span class="keywordflow">break</span>;
+00126 break;
+00127
+00128 if (vstr == NULL)
+00129 break;
00130
-00131 len = <a class="code" href="copy_8c.html#a0">_stp_strncpy_from_user</a>(str, vstr, 128);
+00131 len = _stp_strncpy_from_user(str, vstr, 128);
00132 str[len] = 0;
-00133 <a class="code" href="map_8c.html#a27">_stp_list_add_str</a> (list, str);
+00133 _stp_list_add_str (list, str);
00134 argv++;
00135 }
-00136 <span class="keywordflow">return</span> list-&gt;<a class="code" href="structmap__root.html#o2">num</a>;
+00136 return list-&gt;num;
00137 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Mar 21 13:29:45 2005 for SystemTap by&nbsp;
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.1 </small></address>
-</body>
+</pre></div><hr size="1"><address style="align: right;"><small>
+Generated on Tue Mar 22 00:32:02 2005 for SystemTap.</small></body>
</html>