rpma_atomic_write(3)
π rpma_atomic_write(3) π
okay bestie, so this is from the RPMA Programmer's Manual and it's literally the whole tea on rpma_atomic_write β one function, eight little bytes, maximum drama. sit down, hydrate, let's go β¨
πΈ NAME πΈ
rpma_atomic_write β initiate the atomic 8 bytes write operation
like. it writes 8 bytes. atomically. that's the vibe. periodt π
π SYNOPSIS π
#include <librpma.h>
struct rpma_conn;
struct rpma_mr_remote;
int rpma_atomic_write(struct rpma_conn *conn,
struct rpma_mr_remote *dst, size_t dst_offset,
const char src[8], int flags, const void *op_context);
she's giving forward declarations and one very specific little signature π¦ no cap, copy it exactly.
β¨ DESCRIPTION β¨
so rpma_atomic_write() initiates the atomic 8 bytes write operation β that's moving data from the local memory over to the remote memory. and the way this one works? it transfers exactly 8 bytes of data and stores them atomically in the remote memory. not 7, not 9. eight. iconic behaviour honestly π₯
the attribute flags set the completion notification indicator:
RPMA_F_COMPLETION_ON_ERRORβ generate the completion on errorRPMA_F_COMPLETION_ALWAYSβ generate the completion regardless of result of the operation.
and op_context? she gets returned in the wr_id field of the completion (which is a struct ibv_wc). so you hand her something cute, and she hands it right back through the completion. we love a round trip π
π RETURN VALUE π
rpma_atomic_write() returns 0 on success or a negative error code on failure. simple as that, bestie.
π ERRORS π
rpma_atomic_write() can fail with the following errors:
RPMA_E_INVALβconn,dstorsrcis NULLRPMA_E_INVALβdst_offsetis not aligned to 8 bytesRPMA_E_INVALβ flags are not set (flags == 0)RPMA_E_PROVIDERβibv_post_send(3)failed
okay so real talk, the alignment one is not a suggestion.dst_offsethas to be aligned to 8 bytes or she WILL hit you withRPMA_E_INVAL. no flagging, no half-vibes, noflags == 0. got it? got it π«Ά
π SEE ALSO π
rpma_conn_req_connect(3)rpma_mr_reg(3)rpma_mr_remote_from_descriptor(3)librpma(7)- https://pmem.io/rpma/
and that's the whole page, bestie β¨ this one's from RPMA, dated 01 April 2024, and it lives at rpma_atomic_write(3) β go forth and write exactly 8 bytes, atomically, like the main character you are ππ§πΈ
π¦ 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