.\" Extracted by src2man from /build/rpma-11eW7Q/rpma-1.3.0/src/include/librpma.h .\" Text automatically generated by txt2man .TH rpma_mr_reg 3 "29 May 2023" "RPMA" "RPMA Programmer's Manual" .SH NAME \fBrpma_mr_reg \fP- create a local memory registration object .SH SYNOPSIS .nf .fam C #include struct rpma_peer; struct rpma_mr_local; int \fBrpma_mr_reg\fP(struct rpma_peer *peer, void *ptr, size_t size, int usage, struct rpma_mr_local **mr_ptr); .fam T .fi .fam T .fi .SH DESCRIPTION \fBrpma_mr_reg\fP() registers a memory region and creates a local memory registration object. The usage parameter specifies the operations that can be performed on the given memory region which should be expressed as bitwise-inclusive OR of the following: .IP \(bu 3 RPMA_MR_USAGE_READ_SRC - memory used as a source of the read operation .IP \(bu 3 RPMA_MR_USAGE_READ_DST - memory used as a destination of the read operation .IP \(bu 3 RPMA_MR_USAGE_WRITE_SRC - memory used as a source of the write operation .IP \(bu 3 RPMA_MR_USAGE_WRITE_DST - memory used as a destination of the write operation .IP \(bu 3 RPMA_MR_USAGE_FLUSH_TYPE_VISIBILITY - memory with available flush operation .IP \(bu 3 RPMA_MR_USAGE_FLUSH_TYPE_PERSISTENT - memory with available persistent flush operation .IP \(bu 3 RPMA_MR_USAGE_SEND - memory used for send operation .IP \(bu 3 RPMA_MR_USAGE_RECV - memory used for receive operation .SH RETURN VALUE The \fBrpma_mr_reg\fP() function returns 0 on success or a negative error code on failure. \fBrpma_mr_reg\fP() does not set *mr_ptr value on failure. .SH ERRORS \fBrpma_mr_reg\fP() can fail with the following errors: .IP \(bu 3 RPMA_E_INVAL - peer or ptr or mr_ptr is NULL .IP \(bu 3 RPMA_E_INVAL - size equals 0 .IP \(bu 3 RPMA_E_NOMEM - out of memory .IP \(bu 3 RPMA_E_PROVIDER - memory registration failed .SH SEE ALSO \fBrpma_conn_req_recv\fP(3), \fBrpma_mr_dereg\fP(3), \fBrpma_mr_get_descriptor\fP(3), \fBrpma_mr_get_descriptor_size\fP(3), \fBrpma_peer_new\fP(3), \fBrpma_read\fP(3), \fBrpma_recv\fP(3), \fBrpma_send\fP(3), \fBrpma_write\fP(3), \fBrpma_atomic_write\fP(3), \fBlibrpma\fP(7) and https://pmem.io/rpma/