Commit | Line | Data |
---|---|---|
b7cdc182 | 1 | /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
9f36eaed | 2 | * |
4ac10b76 MD |
3 | * wrapper/file.h |
4 | * | |
5 | * wrapper around linux/file.h. | |
6 | * | |
7 | * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
4ac10b76 MD |
8 | */ |
9 | ||
9f36eaed MJ |
10 | #ifndef _LTTNG_WRAPPER_FILE_H |
11 | #define _LTTNG_WRAPPER_FILE_H | |
12 | ||
4ac10b76 MD |
13 | #include <linux/version.h> |
14 | #include <linux/file.h> | |
15 | ||
16 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
17 | ||
18 | static | |
19 | inline int lttng_get_unused_fd(void) | |
20 | { | |
21 | return get_unused_fd_flags(0); | |
22 | } | |
23 | ||
b06ed645 MD |
24 | #define lttng_f_dentry f_path.dentry |
25 | ||
4ac10b76 MD |
26 | #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ |
27 | ||
28 | static | |
29 | inline int lttng_get_unused_fd(void) | |
30 | { | |
31 | return get_unused_fd(); | |
32 | } | |
33 | ||
b06ed645 MD |
34 | #define lttng_f_dentry f_dentry |
35 | ||
4ac10b76 MD |
36 | #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ |
37 | ||
38 | #endif /* _LTTNG_WRAPPER_FILE_H */ |