1PMEM2_CONFIG_NEW(3)        PMDK Programmer's Manual        PMEM2_CONFIG_NEW(3)
2
3
4

NAME

6       pmem2_config_new(), pmem2_config_delete() - allocate and free a config‐
7       uration structure for a libpmem2 mapping
8

SYNOPSIS

10              #include <libpmem2.h>
11
12              struct pmem2_config;
13              int pmem2_config_new(struct pmem2_config **cfg);
14              int pmem2_config_delete(struct pmem2_config **cfg);
15

DESCRIPTION

17       The pmem2_config_new() function instantiates a new (opaque)  configura‐
18       tion  structure,  pmem2_config, which is used to define mapping parame‐
19       ters for a pmem2_map_new() function, and returns it through the pointer
20       in *cfg.
21
22       New  configuration  is  always initialized with default values for most
23       parameters, which are  specified  alongside  the  corresponding  setter
24       function.   The  application  must explicitly set the granularity value
25       for the mapping.
26
27       The pmem2_config_delete() function frees *cfg  returned  by  pmem2_con‐
28       fig_new() and sets *cfg to NULL.  If *cfg is NULL, no operation is per‐
29       formed.
30

RETURN VALUE

32       The pmem2_config_new() function returns 0 on success or a negative  er‐
33       ror code on failure.  pmem2_config_new() does set *cfg to NULL on fail‐
34       ure.
35
36       The pmem2_config_delete() function always returns 0.
37

ERRORS

39       pmem2_config_new() can fail with the following error: - -ENOMEM  -  out
40       of memory
41

SEE ALSO

43       errno(3),   pmem2_map_new(3),   pmem2_config_set_handle(3),  pmem2_con‐
44       fig_set_fd(3),    pmem2_config_get_file_size(3),    libpmem2(7)     and
45       <https://pmem.io>
46
47
48
49PMDK - pmem2 API version 1.0      2022-05-24               PMEM2_CONFIG_NEW(3)
Impressum