27 return MEMFD_API_ERROR_NO_SIZE;
30 memfd->
name =
format (0,
"memfd svm region %d", master_index);
36 return MEMFD_API_ERROR_CREATE_FAILURE;
42 return MEMFD_API_ERROR_SET_SIZE;
62 if (memfd->
sh == MAP_FAILED)
66 return MEMFD_API_ERROR_MMAP;
103 sh = (
void *) mmap (0,
MMAP_PAGESIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
105 if (sh == MAP_FAILED)
109 return MEMFD_API_ERROR_MMAP;
118 PROT_READ | PROT_WRITE,
119 MAP_SHARED | MAP_FIXED, memfd->
fd, 0);
121 if (sh == MAP_FAILED)
125 return MEMFD_API_ERROR_MMAP;
#define MFD_ALLOW_SEALING
#define vec_c_string_is_terminated(V)
Test whether a vector is a NULL terminated c-string.
static int memfd_create(const char *name, unsigned int flags)
static u64 clib_cpu_time_now(void)
#define MHEAP_FLAG_THREAD_SAFE
#define MHEAP_FLAG_DISABLE_VM
static uword pointer_to_uword(const void *p)
int memfd_master_init(memfd_private_t *memfd, u32 master_index)
memfd_shared_header_t * sh
int memfd_slave_init(memfd_private_t *memfd)
static void * memfd_push_heap(memfd_shared_header_t *sh)
void * mheap_alloc_with_flags(void *memory, uword memory_size, uword flags)
#define clib_unix_warning(format, args...)
static void memfd_pop_heap(void *oldheap)