Cleanup: Move wrapper/ headers to include/wrapper/
[lttng-modules.git] / include / wrapper / uuid.h
diff --git a/include/wrapper/uuid.h b/include/wrapper/uuid.h
new file mode 100644 (file)
index 0000000..d8ac53d
--- /dev/null
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * wrapper/uuid.h
+ *
+ * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_UUID_H
+#define _LTTNG_WRAPPER_UUID_H
+
+#include <linux/version.h>
+#include <linux/uuid.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
+static inline
+void lttng_guid_gen(guid_t *u)
+{
+       return guid_gen(u);
+}
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
+
+typedef uuid_le guid_t;
+
+static inline
+void lttng_guid_gen(guid_t *u)
+{
+       return uuid_le_gen(u);
+}
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
+
+#endif /* _LTTNG_WRAPPER_UUID_H */
This page took 0.025286 seconds and 4 git commands to generate.