rpma_cq_get_fd(3)

πŸ“¦
version 1.3.0 Β· 3 versions
, in ubuntu noble

πŸ’– rpma_cq_get_fd(3) πŸ’–

okay bestie, welcome to the RPMA Programmer's Manual ✨ this one's all about grabbing the completion queue's file descriptor, and honestly? it's giving main character energy πŸŽ€


✨ NAME ✨

rpma_cq_get_fd β€” get the completion queue's file descriptor πŸ¦‹


🌸 SYNOPSIS 🌸

#include <librpma.h>

struct rpma_cq;
int rpma_cq_get_fd(const struct rpma_cq *cq, int *fd);

πŸ’… DESCRIPTION πŸ’…

so rpma_cq_get_fd() grabs you the file descriptor of the completion queue β€” aka the CQ, bestie, we abbreviate around here πŸ’œ

when the next completion in the CQ is ready to be consumed by rpma_cq_get_wc(3), the notification gets delivered to you through that file descriptor. that's the whole vibe. that's the pipeline. πŸ”₯

the default mode of the file descriptor is blocking, but like… you can switch it to non-blocking mode using fcntl(2). your call, your rules πŸ’…

now, the CQ in question is one of these three cuties β€” no more, no less:

pick your fighter, details are in those pages 🫢

⚠️ note, and this is lowkey important: after you spot the notification using the file descriptor you were given, you do not have to call rpma_cq_wait(3) before consuming the completion. no cap. BUT β€” and it's a big but β€” it may cause the next call to rpma_cq_wait(3) to notify you of a completion you already consumed. awkward. 😭 consider yourself warned, bestie.

πŸŽ€ RETURN VALUE πŸŽ€

rpma_cq_get_fd() returns 0 on success, or a negative error code on failure. and listen β€” on failure it does not set the *fd value. like, at all. don't go reading it. πŸ™ˆ


🌈 ERRORS 🌈

rpma_cq_get_fd() can fail with the following error:

  • RPMA_E_INVAL β€” cq or fd is NULL πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

fcntl(2), rpma_conn_get_cq(3), rpma_conn_get_rcq(3), rpma_srq_get_rcq(3), rpma_cq_wait(3), rpma_cq_get_wc(3), librpma(7) and https://pmem.io/rpma/


okay that's the whole page, you absolutely ate it bestie πŸ“ this was the RPMA manual page, dropped on 01 April 2024 ⭐ go get those completions, periodt πŸ’–βœ¨πŸ§š

πŸ“¦ where this page comes from