Cleanup: Move wrapper/ headers to include/wrapper/
[lttng-modules.git] / include / wrapper / file.h
diff --git a/include/wrapper/file.h b/include/wrapper/file.h
new file mode 100644 (file)
index 0000000..b179995
--- /dev/null
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * wrapper/file.h
+ *
+ * wrapper around linux/file.h.
+ *
+ * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_FILE_H
+#define _LTTNG_WRAPPER_FILE_H
+
+#include <linux/version.h>
+#include <linux/file.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
+
+static
+inline int lttng_get_unused_fd(void)
+{
+       return get_unused_fd_flags(0);
+}
+
+#define lttng_f_dentry f_path.dentry
+
+#else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */
+
+static
+inline int lttng_get_unused_fd(void)
+{
+       return get_unused_fd();
+}
+
+#define lttng_f_dentry f_dentry
+
+#endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */
+
+#endif /* _LTTNG_WRAPPER_FILE_H */
This page took 0.023464 seconds and 4 git commands to generate.