Add uuid wrapper for kernels < 2.6.35
[lttng-modules.git] / wrapper / uuid.h
diff --git a/wrapper/uuid.h b/wrapper/uuid.h
new file mode 100644 (file)
index 0000000..569ccab
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _LTT_WRAPPER_UUID_H
+#define _LTT_WRAPPER_UUID_H
+
+/*
+ * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com)
+ *
+ * Dual LGPL v2.1/GPL v2 license.
+ */
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+#include <linux/uuid.h>
+#else
+
+#include <linux/random.h>
+
+typedef struct {
+       __u8 b[16];
+} uuid_le;
+
+static inline
+void uuid_le_gen(uuid_le *u)
+{
+       genarate_random_uuid(u);
+}
+
+#endif
+#endif /* _LTT_WRAPPER_UUID_H */
This page took 0.022648 seconds and 4 git commands to generate.