+#ifndef ONCE_LTTNG_RPC_H
+#define ONCE_LTTNG_RPC_H
+
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0))
+static inline
+int lttng_get_clid(const struct rpc_task *task)
+{
+ struct rpc_clnt *tk_client;
+
+ tk_client = task->tk_client;
+ if (!tk_client)
+ return -1;
+ /*
+ * The cl_clid field is always initialized to positive signed
+ * integers. Negative signed integer values are treated as
+ * errors.
+ */
+ return (int) tk_client->cl_clid;
+}
+#endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */
+
+#endif /* ONCE_LTTNG_RPC_H */
+
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,0,0) || \
+ LTTNG_RHEL_KERNEL_RANGE(4,18,0,193,0,0, 4,19,0,0,0,0))