PMEM2_CONFIG_SET_VM_RESERVATION(3)

πŸ’– pmem2_config_set_vm_reservation() πŸ’–

okay bestie, welcome to the PMDK Programmer's Manual β€” section 3, the lil corner where libpmem2 lives. this one's short and sweet, so let's go 🫢


✨ NAME ✨

pmem2_config_set_vm_reservation() β€” sets the pmem2_vm_reservation structure basing on the values in the pmem2_config structure πŸ’…

like, it literally just takes what's in your config and copies the vibe over to the reservation struct. no cap.


🌸 SYNOPSIS 🌸

#include <libpmem2.h>

struct pmem2_config;
struct pmem2_vm_reservation;
int pmem2_config_set_vm_reservation(struct pmem2_config *config,
        struct pmem2_vm_reservation *rsv, size_t rsv_offset);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the pmem2_config_set_vm_reservation() function sets the virtual memory reservation and an offset to be used during a mapping. it's giving "here's where you're mapping, and here's exactly where in that space you start" ✨

rsv should be already initialized. please see pmem2_vm_reservation_new(3) for details β€” don't come at me with an uninitialized reservation, i'm begging πŸ™ˆ

rsv_offset marks the offset in the reservation for the mapping. like, the lil bookmark saying "start here" πŸ“Œ


πŸ’€ RETURN VALUE πŸ’€

pmem2_config_set_vm_reservation() function always returns 0.

periodt. no error codes, no drama, no surprises. it just works and hands you a 0. iconic behavior honestly πŸ‘‘


🌈 SEE ALSO 🌈


πŸ’œ reminder bestie: rsv has to be initialized first, okay? that's the whole plot twist of this page.

that's the whole thing, we ate and left no crumbs πŸ“ this was PMDK, dated 2025-07-24 β€” mwah, love u, go map something πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from