rpma_mr_reg(3)
π rpma_mr_reg β like, the memory registration page π
okay bestie, welcome to rpma_mr_reg from the RPMA Programmer's Manual β¨ this is the one where you tell the system "hey, this chunk of memory? mine. register it, pls" π
β¨ NAME β¨
rpma_mr_reg β create a local memory registration object π¦
β¨ SYNOPSIS β¨
#include <librpma.h>
struct rpma_peer;
struct rpma_mr_local;
int rpma_mr_reg(struct rpma_peer *peer, void *ptr, size_t size, int usage,
struct rpma_mr_local **mr_ptr);
β¨ DESCRIPTION β¨
so rpma_mr_reg() does the thing: it registers a memory region and creates a local memory registration object. periodt π
the usage parameter is the moment where you say what operations are allowed on this memory region. and the way you say it? bitwise-inclusive OR of these icons right here π
RPMA_MR_USAGE_READ_SRCβ memory used as a source of the read operationRPMA_MR_USAGE_READ_DSTβ memory used as a destination of the read operationRPMA_MR_USAGE_WRITE_SRCβ memory used as a source of the write operationRPMA_MR_USAGE_WRITE_DSTβ memory used as a destination of the write operationRPMA_MR_USAGE_FLUSH_TYPE_VISIBILITYβ memory with available flush operationRPMA_MR_USAGE_FLUSH_TYPE_PERSISTENTβ memory with available persistent flush operationRPMA_MR_USAGE_SENDβ memory used for send operationRPMA_MR_USAGE_RECVβ memory used for receive operation
like, stack them up with OR and you're giving your memory its whole personality π
β¨ RETURN VALUE β¨
rpma_mr_reg() returns 0 on success, or a negative error code on failure. and listen β on failure it does NOT set the *mr_ptr value. not even a little. don't go reading it, bestie π
β¨ ERRORS β¨
rpma_mr_reg() can fail with these, so know them, fr fr:
RPMA_E_INVALβpeerorptrormr_ptrisNULLRPMA_E_INVALβsizeequals0RPMA_E_NOMEMβ out of memoryRPMA_E_PROVIDERβ memory registration failed
β¨ SEE ALSO β¨
go read these next, iykyk π
rpma_conn_req_recv(3)rpma_mr_dereg(3)rpma_mr_get_descriptor(3)rpma_mr_get_descriptor_size(3)rpma_peer_new(3)rpma_read(3)rpma_recv(3)rpma_send(3)rpma_write(3)rpma_atomic_write(3)librpma(7)https://pmem.io/rpma/
lowkey reminder bestie:RPMA_E_INVALshows up twice for a reason βNULLpointer stuff AND asizeof0both get it. different crimes, same error π
and that's the whole page, no cap π«Ά this was the RPMA manual, version dated 01 April 2024 β slay, go register some memory, you absolute main character πΈπβ¨
π¦ where this page comes from
- ubuntu noble: librpma-dev 1.3.0-2build2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms