+static inline
+int shm_get_wakeup_fd(struct shm_handle *handle, struct shm_ref *ref)
+{
+ 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];
+ return obj->wait_fd[1];
+
+}
+
+static inline
+int shm_get_wait_fd(struct shm_handle *handle, struct shm_ref *ref)
+{
+ 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];
+ 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->allocated_len;
+ return 0;
+}
+