shbuf_create - create a shareable memory buffer
#include <SharedBuffer.h>
int shbuf_create(int size, void** buffer);
Creates a new memory region that can be shared with other processes. The region is only accessible to the calling process by default.
If a region is successfully created, shbuf_create()
stores a pointer to the memory in buffer
and returns a buffer ID. Otherwise, it returns -1 and sets errno
to describe the error.
EINVAL
: size
is zero or negative.EFAULT
: buffer
is not a valid address.