AM263x MCU+ SDK  09.02.00
Shared memory IPC utility functions

Introduction

Files

file  cb_ipcshmem.h
 Shared memory IPC utility functions.
 

Functions

void * cb_get_shared_mem (int *memfd, const char *shmname, size_t size, int flag)
 get new shared memory More...
 
int cb_close_shared_mem (void *mem, int *memfd, const char *shmname, size_t size, bool unlink)
 close shared memory More...
 

Function Documentation

◆ cb_get_shared_mem()

void* cb_get_shared_mem ( int *  memfd,
const char *  shmname,
size_t  size,
int  flag 
)

get new shared memory

Parameters
memfdshared memory file descriptor
shmnameshared memory name to be used for shm_open
sizesize of shared memroy
flagflag to be used for shm_open i.e O_RDONLY, O_RDWR, O_WRONLY, O_CREAT, O_EXCL,O_TRUNC.
See also
man shm_open().
Returns
a reference to the new shared memory, NULL if error

◆ cb_close_shared_mem()

int cb_close_shared_mem ( void *  mem,
int *  memfd,
const char *  shmname,
size_t  size,
bool  unlink 
)

close shared memory

Parameters
memmapped shared memory
memfdshared memory file descriptor
shmnameshared memory name
sizesize of shared memory
unlinkflag indicating if shared memory will be unlinked
Returns
0 on success, -1 on error