X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Fshm.h;h=5785b71d8483d26c3684bdd8875c70aa13f00ca2;hb=381c0f1ef474e0ae8a96b3753470ca4bda45c764;hp=22c9afdcbd2beaf557aa894ca37cd975908f3b37;hpb=4e2ee1f5ad0b837440f3b850e971f25db209cca1;p=lttng-ust.git diff --git a/libringbuffer/shm.h b/libringbuffer/shm.h index 22c9afdc..5785b71d 100644 --- a/libringbuffer/shm.h +++ b/libringbuffer/shm.h @@ -103,4 +103,22 @@ int shm_get_wait_fd(struct shm_handle *handle, struct shm_ref *ref) return obj->wait_fd[0]; } +static inline +int shm_get_object_data(struct shm_handle *handle, struct shm_ref *ref, + int *shm_fd, int *wait_fd, uint64_t *memory_map_size) +{ + struct shm_object_table *table = handle->table; + struct shm_object *obj; + size_t index; + + index = (size_t) ref->index; + if (unlikely(index >= table->allocated_len)) + return -EPERM; + obj = &table->objects[index]; + *shm_fd = obj->shm_fd; + *wait_fd = obj->wait_fd[0]; + *memory_map_size = obj->memory_map_size; + return 0; +} + #endif /* _LIBRINGBUFFER_SHM_H */