ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/pase__memcpy_wt.htm

179 lines
4.7 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>_MEMCPY_WT()--Copy Memory With Tags for i5/OS PASE</title>
<!-- Begin Header Records -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Created by V2DCIJB on 23 Nov 1999 -->
<!-- Edited by Kersten Jan 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>_MEMCPY_WT()--Copy Memory With Tags for i5/OS PASE</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Syntax
<pre>
#include &lt;as400_protos.h&gt;
void* _MEMCPY_WT(void *target,
const void *source,
size_t length);
void _MEMCPY_WT2(const ILEpointer *target,
const ILEpointer *source,
size_t length);
</pre>
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Library: Standard C Library (libc.a)<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p><strong>Note:</strong> These functions can only be used in an i5/OS PASE
program. See <a href="../rzalf/rzalfintro.htm">i5/OS PASE</a> for more
information about creating i5/OS PASE programs.</p>
<p>The _MEMCPY_WT() and _MEMCPY_WT2() functions copy memory without destroying
16-byte tagged pointers.</p>
<p>Standard memory copy functions such as memcpy never produce a usable tagged
pointer in the target memory. _MEMCPY_WT and _MEMCPY_WT2 copy memory in a way
that preserves the integrity of any complete (16-byte) tagged pointers copied,
as long as the source and target have the same alignment with respect to a
16-byte boundary.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>target</strong></dt>
<dd>(Output) Pointer to target memory. For _MEMCPY_WT, target is the i5/OS
PASE address of the target memory. For _MEMCPY_WT2, target is the 16-byte
aligned address of a tagged space pointer to the target memory.<br>
<br>
</dd>
<dt><strong>source</strong></dt>
<dd>(Input) Pointer to source memory. For _MEMCPY_WT, source is the i5/OS PASE
address of the source memory. For _MEMCPY_WT2, source is the 16-byte aligned
address of a tagged space pointer to the source memory.<br>
<br>
</dd>
<dt><strong>length</strong></dt>
<dd>(Input) Specifies the number of bytes to copy between the source and
target.<br>
</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>_MEMCPY_WT and _MEMCPY_WT2 require no authority.</p>
<br>
<h3>Return Value</h3>
<p>_MEMCPY_WT returns the target memory address. _MEMCPY_WT2 returns no
function result.</p>
<br>
<h3>Error Conditions</h3>
<p>Any error is reported with an i5/OS exception message that the system
converts to an i5/OS PASE signal. See <a href="pase_signals.htm">i5/OS PASE
Signal Handling</a> for information about handling i5/OS exceptions.</p>
<br>
<h3>Usage Notes</h3>
<ol>
<li>_MEMCPY_WT only copies between memory areas in the i5/OS PASE address
space. _MEMCPY_WT2 can copy between any memory areas addressable through tagged
space pointers, which need not be in the i5/OS PASE address space.<br>
<br>
</li>
<li>Memory is copied without error if the source and target do not have the
same alignment with respect to a 16-byte boundary or if only part of a tagged
pointer is copied, but the target will not contain a usable tagged pointer.<br>
<br>
</li>
<li>_MEMCPY_WT and _MEMCPY_WT2 are implemented with kernel system calls, so
they generally run slower than memcpy.<br>
<br>
</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="pase__cvtspp.htm">_CVTSPP()--Convert Space Pointer for i5/OS
PASE</a></li>
<li><a href="pase__setspp.htm">_SETSPP()--Set Space Pointer for i5/OS
PASE</a></li>
<li><a href="pase__setsppm.htm">_SETSPPM()--Set Multiple Space Pointers for i5/OS
PASE</a></li>
</ul>
<br>
<hr>
API introduced: V4R5
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"pase1.htm">i5/OS PASE APIs</a> | <a href="aplist.htm">APIs by category</a>
</td>
</tr>
</table>
</center>
</body>
</html>