AM261x MCU+ SDK: Shared memory IPC utility functions

| AM261x MCU+ SDK 26.00.00 |

Files | Functions
Shared memory IPC utility functions
APIs for combase Binding

## 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

  memfd | shared memory file descriptor
  shmname | shared memory name to be used for shm_open
  size | size of shared memroy
  flag | flag 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

  mem | mapped shared memory
  memfd | shared memory file descriptor
  shmname | shared memory name
  size | size of shared memory
  unlink | flag indicating if shared memory will be unlinked

Returns
  0 on success, -1 on error