Commit | Line | Data |
---|---|---|
9f36eaed MJ |
1 | /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) |
2 | * | |
886d51a3 | 3 | * wrapper/uuid.h |
a864fb02 | 4 | * |
886d51a3 | 5 | * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
a864fb02 MD |
6 | */ |
7 | ||
9f36eaed MJ |
8 | #ifndef _LTTNG_WRAPPER_UUID_H |
9 | #define _LTTNG_WRAPPER_UUID_H | |
10 | ||
a864fb02 MD |
11 | #include <linux/version.h> |
12 | ||
13 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) | |
14 | #include <linux/uuid.h> | |
15 | #else | |
16 | ||
17 | #include <linux/random.h> | |
18 | ||
19 | typedef struct { | |
20 | __u8 b[16]; | |
21 | } uuid_le; | |
22 | ||
23 | static inline | |
24 | void uuid_le_gen(uuid_le *u) | |
25 | { | |
c40673b8 | 26 | generate_random_uuid(u->b); |
a864fb02 MD |
27 | } |
28 | ||
29 | #endif | |
a90917c3 | 30 | #endif /* _LTTNG_WRAPPER_UUID_H */ |