Implement ioctl-alike communication
[lttng-ust.git] / libust / lttng-ust-abi.c
index 01512128f24b478e9bea2bef795ba89eb04e97b7..5f4ba8916da496c0f0b0f5867a996e13fa9b39e1 100644 (file)
  * by the caller.
  */
 
-struct obj;
-
-struct objd_ops {
-       long (*cmd)(int objd, unsigned int cmd, unsigned long arg);
-       int (*release)(int objd);
-};
-
 struct obj {
        union {
                struct {
@@ -131,10 +124,10 @@ void objd_set_private(int id, void *private_data)
        obj->u.s.private_data = private_data;
 }
 
-static
 const struct objd_ops *objd_ops(int id)
 {
        struct obj *obj = _objd_get(id);
+
        if (!obj)
                return NULL;
        return obj->u.s.ops;
@@ -213,6 +206,15 @@ enum channel_type {
        METADATA_CHANNEL,
 };
 
+int lttng_abi_create_root_handle(void)
+{
+       int root_handle;
+
+       root_handle = objd_alloc(NULL, &lttng_ops);
+       assert(root_handle == 0);
+       return root_handle;
+}
+
 int lttng_abi_create_session(void)
 {
        struct ltt_session *session;
@@ -355,7 +357,6 @@ create_error:
        return;         /* not allowed to return error */
 }
 
-static
 int lttng_abi_create_channel(int session_objd,
                             struct lttng_ust_channel *chan_param,
                             enum channel_type channel_type)
This page took 0.023955 seconds and 4 git commands to generate.