memobj_wrap_attr_set_fd_and_offset()

Set the file descriptor and offset of the shared memory to be associated with the memory object handle

Synopsis:

#include <memobj/wrap.h>
void memobj_wrap_attr_set_fd_and_offset(struct memobj_wrap_attr *attr, int fd, off64_t offset)

Arguments:

attr
The attribute structure to modify.
fd
The file descriptor of the shared memory to wrap. During a memobj_create_wrapped() call, a new file descriptor is opened for the shared memory object. The new file descriptor is associated with a memory object handle and closed during memobj_close(). The original shared memory file descriptor can be closed after memobj_create_wrapped(). The shared memory object still persists until the last reference to it is closed.
offset
An offset into fd, where the memory object starts.

Library:

libmemobj

Description:

The memobj_wrap_attr_set_fd_and_offset() function sets the file descriptor and offset of the shared memory to be associated with the memory object handle.
Note:
Don't specify fd and offset if you're also specifying virtual address of the memory via memobj_wrap_attr_set_vaddr(). Giving both attributes causes memobj_create_wrapped() to fail with EINVAL. To reset these settings, pass -1 for fd and 0 for offset, or NULL for vaddr.
Page updated: