shm implemented as memfd syscall
cheliequan
2022-12-04 14278bd98326f0afdd86fe4ec24e747b0e0b712a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
#ifndef MEMFD_H  
#define MEMFD_H  
#include "unistd.h"
 
#ifdef __cplusplus 
extern "C" { 
#endif
 
int basic_shm_create(char *name, ssize_t len);
int basic_shm_open(int fd, pid_t pid, int flags);
int basic_shm_mmap(int fd, unsigned char** ppaddr);
int basic_shm_unmmap(int fd, unsigned char** ppaddr);
int basic_shm_close(int fd);
int basic_shm_shrink(int fd, ssize_t len);
int basic_shm_grow(int fd, ssize_t len);
 
enum{
   local_open_flag = 0,
   remote_open_flag
};
 
#ifdef __cplusplus 
#endif
#endif