PMEM2_CONFIG_SET_REQUIRED_STORE_GRANULARITY(3)
β¨ NAME β¨
pmem2_config_set_required_store_granularity() β bestie, this one sets a granularity inside the pmem2_config structure π
So this is from the PMDK Programmer's Manual (yes, that PMDK), and it's a little function that lives in the libpmem2 world. Let's get into it π¦
πΈ SYNOPSIS πΈ
Okay so first you gotta pull in the header, obviously:
#include <libpmem2.h>
Then there's this enum, and it's giving very much "pick one of three":
enum pmem2_granularity {
PMEM2_GRANULARITY_BYTE,
PMEM2_GRANULARITY_CACHE_LINE,
PMEM2_GRANULARITY_PAGE,
};
And here's the function itself, no cap:
int pmem2_config_set_required_store_granularity(struct pmem2_config *cfg,
enum pmem2_granularity g);
π DESCRIPTION π
So pmem2_config_set_required_store_granularity() sets a maximum permitted granularity g that the user is requesting, and it tucks that value right into the pmem2_config structure. Literally just vibes being configured, but make it granularity π
And g has to be one of these three, periodt:
PMEM2_GRANULARITY_BYTEPMEM2_GRANULARITY_CACHE_LINEPMEM2_GRANULARITY_PAGE
Now if you're sitting there like "bestie what even is granularity" π β the whole concept is explained over in the libpmem2(7) manpage. Go read that one, it's the main character of the granularity lore π
π«Ά RETURN VALUE π«Ά
pmem2_config_set_required_store_granularity() returns 0 when it slays (success), or a negative error code when it does not (failure). That's it, that's the whole vibe check π
π ERRORS π
It can fail with this one, and only this one:
PMEM2_E_GRANULARITY_NOT_SUPPORTEDβ the granularitygis not a valid value π
Fr fr, if you pass something that isn't one of the three enum values, this is what you get. No guessing, no mercy.
π SEE ALSO π
And that's the whole page, babe π This little cutie came straight out of the PMDK Programmer's Manual, dated 2025-07-24. Now go configure something iconic πβ¨
π¦ 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 2020, Intel Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms