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

NAME

6       pmem2_source_from_anon() - creates data source backed by anonymous mem‐
7       ory pages
8

SYNOPSIS

10              #include <libpmem2.h>
11
12              int pmem2_source_from_anon(struct pmem2_source **src, size_t size);
13

DESCRIPTION

15       The  pmem2_source_from_anon()  function  instantiates  a   new   struct
16       pmem2_source object describing an anonymous data source.  Mappings cre‐
17       ated using this function are not backed by any file and  are  zero-ini‐
18       tialized.
19
20       The  size  argument for the function defines the length in bytes of the
21       anonymous source, as returned by pmem2_source_size(3).  The application
22       should set this value so that it’s greater than or equal to the size of
23       any mapping created with the anonymous source.
24
25       The offset value for mapping is ignored.
26

RETURN VALUE

28       The pmem2_source_from_anon() function returns 0 on success or  a  nega‐
29       tive error code on failure.
30

ERRORS

32       The pmem2_source_form_anon() can fail with the following errors:
33
34-ENOMEM  -  in case of insufficient memory to allocate an instance of
35         struct pmem2_source.
36

SEE ALSO

38       errno(3),         pmem2_config_set_length(3),         pmem2_map_new(3),
39       pmem2_source_size(3),   pmem2_config_set_length(3),   libpmem2(7)   and
40       <http://pmem.io>
41
42
43
44PMDK - pmem2 API version 1.0      2020-10-28         PMEM2_SOURCE_FROM_ANON(3)
Impressum