PMEM2_CONFIG_SET_LENGTH(3)
π PMEM2_CONFIG_SET_LENGTH(3) π
okay bestie, welcome to the PMDK Programmer's Manual, page PMEM2_CONFIG_SET_LENGTH(3) β yes the title is a whole mouthful, iykyk, but we're gonna make it make sense π«Ά
β¨ NAME β¨
pmem2_config_set_length() β set length in the pmem2_config structure πΈ
β¨ SYNOPSIS β¨
#include <libpmem2.h>
struct pmem2_config;
int pmem2_config_set_length(struct pmem2_config *config, size_t length);
β¨ DESCRIPTION β¨
so like, pmem2_config_set_length() sets up the length that's gonna be used for mapping. that's literally its whole job π
quick vibe check though: *config needs to already be initialized before you call this, no exceptions. if you're like "girl, how do i even do that", go read pmem2_config_new(3), it's all there π
also β and this part is important, don't skip it β the length must be a multiple of the alignment required for the data source that's gonna be used for mapping alongside the config. like, the alignment and the length have to be in a committed relationship, fr fr.
need to know what alignment your specific pmem2_source wants? that's pmem2_source_alignment(3), she'll tell you π¦
and by default, if you don't set anything, the length is equal to the size of the file that is being mapped. cute, right? it just figures it out for you β¨
β¨ RETURN VALUE β¨
pmem2_config_set_length() always returns 0. always. no drama, no error codes, no surprises. she is unbothered, moisturized, in her lane π
β¨ SEE ALSO β¨
libpmem2(7)pmem2_map_new(3)pmem2_source_alignment(3)pmem2_config_new(3)sysconf(3)- https://pmem.io
reminder bestie: init the config first, keep that length alignment-friendly, and you're golden π
that's the whole page!! mwah π this was PMDK's manual, dated 2025-07-24, brought to you by the PMDK Programmer's Manual herself β go slay some mappings, you've got this πβ
π¦ where this page comes from
- fedora 43: libpmem2-devel 2.1.0-4.fc43 Β· BSD-3-Clause
- π the page's license: BSD-3-Clause
- Copyright 2019, Intel Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms