memobj_wrap_attr_set_vaddr()

Set the virtual address of the memory to be associated with the memory object handle

Synopsis:

#include <memobj/wrap.h>
void memobj_wrap_attr_set_vaddr(struct memobj_wrap_attr *attr, void *vaddr)

Arguments:

attr
The attribute structure to modify.
vaddr
A virtual address of the memory to wrap. The memory object wraps the physical memory associated with vaddr.

Library:

libmemobj

Description:

The memobj_wrap_attr_set_vaddr() function sets the virtual address of the memory to be associated with the memory object handle.
Note:
Don't specify the virtual address if you're also specifying fd and offset of the memory via memobj_wrap_attr_set_fd_and_offset(). 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.
Note:
The underlying memory must remain valid until the last handle associated with this memory is closed; otherwise, the memory object handle references a freed memory.
Page updated: