/* channel_handle_create - for UST. */
extern
struct lttng_ust_shm_handle *channel_handle_create(void *data,
- uint64_t memory_map_size);
+ uint64_t memory_map_size, int wakeup_fd);
/* channel_handle_add_stream - for UST. */
extern
int channel_handle_add_stream(struct lttng_ust_shm_handle *handle,
size_t memory_map_size);
/* mem ownership is passed to shm_object_table_append_mem(). */
struct shm_object *shm_object_table_append_mem(struct shm_object_table *table,
- void *mem, size_t memory_map_size);
+ void *mem, size_t memory_map_size, int wakeup_fd);
void shm_object_table_destroy(struct shm_object_table *table);
/*
{
struct shm_object_table *table = handle->table;
struct shm_object *obj;
+ int wait_fd;
size_t index;
int ret;
if (caa_unlikely(index >= table->allocated_len))
return -EPERM;
obj = &table->objects[index];
- if (obj->wait_fd[0] < 0)
+ wait_fd = obj->wait_fd[0];
+ if (wait_fd < 0)
return -ENOENT;
- ret = close(obj->wait_fd[0]);
+ obj->wait_fd[0] = -1;
+ ret = close(wait_fd);
if (ret) {
ret = -errno;
return ret;
}
- obj->wait_fd[0] = -1;
return 0;
}
{
struct shm_object_table *table = handle->table;
struct shm_object *obj;
+ int wakeup_fd;
size_t index;
int ret;
if (caa_unlikely(index >= table->allocated_len))
return -EPERM;
obj = &table->objects[index];
- if (obj->wait_fd[1] < 0)
+ wakeup_fd = obj->wait_fd[1];
+ if (wakeup_fd < 0)
return -ENOENT;
- ret = close(obj->wait_fd[1]);
+ obj->wait_fd[1] = -1;
+ ret = close(wakeup_fd);
if (ret) {
ret = -errno;
return ret;
}
- obj->wait_fd[1] = -1;
return 0;
}