summaryrefslogtreecommitdiff
path: root/static/freebsd/man9/proc_rwmem.9 4.html
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:43 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:43 -0400
commitac5e55f5f2af5b92794c2aded46c6bae85b5f5ed (patch)
tree9367490586c84cba28652e443e3166d66c33b0d9 /static/freebsd/man9/proc_rwmem.9 4.html
parent253e67c8b3a72b3a4757fdbc5845297628db0a4a (diff)
docs: Added All FreeBSD Manuals
Diffstat (limited to 'static/freebsd/man9/proc_rwmem.9 4.html')
-rw-r--r--static/freebsd/man9/proc_rwmem.9 4.html95
1 files changed, 95 insertions, 0 deletions
diff --git a/static/freebsd/man9/proc_rwmem.9 4.html b/static/freebsd/man9/proc_rwmem.9 4.html
new file mode 100644
index 00000000..0d391845
--- /dev/null
+++ b/static/freebsd/man9/proc_rwmem.9 4.html
@@ -0,0 +1,95 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">PROC_RWMEM(9)</td>
+ <td class="head-vol">Kernel Developer's Manual</td>
+ <td class="head-rtitle">PROC_RWMEM(9)</td>
+ </tr>
+</table>
+<div class="manual-text">
+<section class="Sh">
+<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
+<p class="Pp"><code class="Nm">proc_rwmem</code>,
+ <code class="Nm">proc_readmem</code>, <code class="Nm">proc_writemem</code>
+ &#x2014; <span class="Nd">read from or write to a process address
+ space</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
+<p class="Pp"><code class="In">#include
+ &lt;<a class="In">sys/types.h</a>&gt;</code>
+ <br/>
+ <code class="In">#include &lt;<a class="In">sys/ptrace.h</a>&gt;</code></p>
+<p class="Pp"><var class="Ft">int</var>
+ <br/>
+ <code class="Fn">proc_rwmem</code>(<var class="Fa" style="white-space: nowrap;">struct
+ proc *p</var>, <var class="Fa" style="white-space: nowrap;">struct uio
+ *uio</var>);</p>
+<p class="Pp"><var class="Ft">ssize_t</var>
+ <br/>
+ <code class="Fn">proc_readmem</code>(<var class="Fa" style="white-space: nowrap;">struct
+ thread *td</var>, <var class="Fa" style="white-space: nowrap;">struct proc
+ *p</var>, <var class="Fa" style="white-space: nowrap;">vm_offset_t va</var>,
+ <var class="Fa" style="white-space: nowrap;">void *buf</var>,
+ <var class="Fa" style="white-space: nowrap;">size_t len</var>);</p>
+<p class="Pp"><var class="Ft">ssize_t</var>
+ <br/>
+ <code class="Fn">proc_writemem</code>(<var class="Fa" style="white-space: nowrap;">struct
+ thread *td</var>, <var class="Fa" style="white-space: nowrap;">struct proc
+ *p</var>, <var class="Fa" style="white-space: nowrap;">vm_offset_t va</var>,
+ <var class="Fa" style="white-space: nowrap;">void *buf</var>,
+ <var class="Fa" style="white-space: nowrap;">size_t len</var>);</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+<p class="Pp">These functions are used to read to or write from the address
+ space of the process <var class="Fa">p</var>. The
+ <a class="permalink" href="#proc_rwmem"><code class="Fn" id="proc_rwmem">proc_rwmem</code></a>()
+ function requires the caller to specify the I/O parameters using a
+ <var class="Vt">struct uio</var>, described in <a class="Xr">uio(9)</a>. The
+ <a class="permalink" href="#proc_readmem"><code class="Fn" id="proc_readmem">proc_readmem</code></a>()
+ and
+ <a class="permalink" href="#proc_writemem"><code class="Fn" id="proc_writemem">proc_writemem</code></a>()
+ functions provide a simpler, less general interface which allows the caller
+ to read into or write the kernel buffer <var class="Fa">buf</var> of size
+ <var class="Fa">len</var> from or to the memory at offset
+ <var class="Fa">va</var> in the address space of <var class="Fa">p</var>.
+ The operation is performed on behalf of thread <var class="Fa">td</var>,
+ which will most often be the current thread.</p>
+<p class="Pp">These functions may sleep and thus may not be called with any
+ non-sleepable locks held. The process <var class="Fa">p</var> must be held
+ by the caller using <a class="Xr">PHOLD(9)</a>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
+ VALUES</a></h1>
+<p class="Pp">The <code class="Fn">proc_rwmem</code>() function returns
+ <code class="Dv">0</code> on success. <code class="Dv">EFAULT</code> is
+ returned if the specified user address is invalid, and
+ <code class="Dv">ENOMEM</code> is returned if the target pages could not be
+ faulted in due to a resource shortage.</p>
+<p class="Pp">The <code class="Fn">proc_readmem</code>() and
+ <code class="Fn">proc_writemem</code>() functions return the number of bytes
+ read or written, respectively. This may be smaller than the number of bytes
+ requested, for example if the request spans multiple pages in the process
+ address space and one of them after the first is not mapped. Otherwise, -1
+ is returned.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
+ ALSO</a></h1>
+<p class="Pp"><a class="Xr">copyin(9)</a>, <a class="Xr">locking(9)</a>,
+ <a class="Xr">PHOLD(9)</a>, <a class="Xr">uio(9)</a></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
+<p class="Pp">This manual page was written by <span class="An">Mark
+ Johnston</span>
+ &lt;<a class="Mt" href="mailto:markj@FreeBSD.org">markj@FreeBSD.org</a>&gt;.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">December 7, 2015</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>