.\" Automatically generated by Pandoc 2.2.1 .\" .TH "RPMEM_PERSIST" "3" "2019-02-19" "PMDK - rpmem API version 1.2" "PMDK Programmer's Manual" .hy .\" Copyright 2014-2019, Intel Corporation .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" * Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" .\" * Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" .\" * Neither the name of the copyright holder nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR .\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT .\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE .\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .SH NAME .PP \f[B]rpmem_persist\f[](), \f[B]rpmem_deep_persist\f[](), \f[B]rpmem_read\f[](), \- functions to copy and read remote pools .SH SYNOPSIS .IP .nf \f[C] #include\ int\ rpmem_persist(RPMEMpool\ *rpp,\ size_t\ offset, \ \ \ \ size_t\ length,\ unsigned\ lane,\ unsigned\ flags); int\ rpmem_deep_persist(RPMEMpool\ *rpp,\ size_t\ offset, \ \ \ \ size_t\ length,\ unsigned\ lane); int\ rpmem_read(RPMEMpool\ *rpp,\ void\ *buff,\ size_t\ offset, \ \ \ \ size_t\ length,\ unsigned\ lane); \f[] .fi .SH DESCRIPTION .PP The \f[B]rpmem_persist\f[]() function copies data of given \f[I]length\f[] at given \f[I]offset\f[] from the associated local memory pool and makes sure the data is persistent on the remote node before the function returns. The remote node is identified by the \f[I]rpp\f[] handle which must be returned from either \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3). The \f[I]offset\f[] is relative to the \f[I]pool_addr\f[] specified in the \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3) call. If the remote pool was created using \f[B]rpmem_create\f[]() with non\-NULL \f[I]create_attr\f[] argument, \f[I]offset\f[] has to be greater or equal to 4096. In that case the first 4096 bytes of the pool is used for storing the pool matadata and cannot be overwritten. If the pool was created with NULL \f[I]create_attr\f[] argument, the pool metadata is not stored with the pool and \f[I]offset\f[] can be any nonnegative number. The \f[I]offset\f[] and \f[I]length\f[] combined must not exceed the \f[I]pool_size\f[] passed to \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3). The \f[B]rpmem_persist\f[]() operation is performed using the given \f[I]lane\f[] number. The lane must be less than the value returned by \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3) through the \f[I]nlanes\f[] argument (so it can take a value from 0 to \f[I]nlanes\f[] \- 1). The \f[I]flags\f[] argument can be 0 or RPMEM_PERSIST_RELAXED which means the persist operation will be done without any guarantees regarding atomicity of memory transfer. .PP The \f[B]rpmem_deep_persist\f[]() function works in the same way as \f[B]rpmem_persist\f[](3) function, but additionally it flushes the data to the lowest possible persistency domain available from software. Please see \f[B]pmem_deep_persist\f[](3) for details. .PP The \f[B]rpmem_read\f[]() function reads \f[I]length\f[] bytes of data from a remote pool at \f[I]offset\f[] and copies it to the buffer \f[I]buff\f[]. The operation is performed on the specified \f[I]lane\f[]. The lane must be less than the value returned by \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3) through the \f[I]nlanes\f[] argument (so it can take a value from 0 to \f[I]nlanes\f[] \- 1). The \f[I]rpp\f[] must point to a remote pool opened or created previously by \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3). .SH RETURN VALUE .PP The \f[B]rpmem_persist\f[]() function returns 0 if the entire memory area was made persistent on the remote node. Otherwise it returns a non\-zero value and sets \f[I]errno\f[] appropriately. .PP The \f[B]rpmem_read\f[]() function returns 0 if the data was read entirely. Otherwise it returns a non\-zero value and sets \f[I]errno\f[] appropriately. .SH SEE ALSO .PP \f[B]rpmem_create\f[](3), \f[B]rpmem_open\f[](3), \f[B]rpmem_persist\f[](3), \f[B]sysconf\f[](3), \f[B]limits.conf\f[](5), \f[B]libpmemobj\f[](7) and \f[B]\f[]