1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
5 * Copyright (C) 2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 #ifndef _LTTNG_WRAPPER_FDTABLE_H
9 #define _LTTNG_WRAPPER_FDTABLE_H
11 #include <lttng/kernel-version.h>
12 #include <linux/fdtable.h>
13 #include <linux/sched.h>
15 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0))
17 struct file
*lttng_lookup_fdget_rcu(unsigned int fd
)
19 return lookup_fdget_rcu(fd
);
22 #elif ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) || \
23 LTTNG_KERNEL_RANGE(5,10,220, 5,11,0))
25 struct file
*lttng_lookup_fdget_rcu(unsigned int fd
)
27 struct file
* file
= lookup_fd_rcu(fd
);
29 if (unlikely(!file
|| !get_file_rcu(file
)))
35 struct file
*lttng_lookup_fdget_rcu(unsigned int fd
)
37 struct file
* file
= fcheck(fd
);
39 if (unlikely(!file
|| !get_file_rcu(file
)))
45 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,10,0))
47 bool lttng_close_on_exec(unsigned int fd
, const struct files_struct
*files
)
49 return close_on_exec(fd
, files
);
53 bool lttng_close_on_exec(unsigned int fd
, const struct files_struct
*files
)
55 return close_on_exec(fd
, files_fdtable(files
));
59 #endif /* _LTTNG_WRAPPER_FDTABLE_H */
This page took 0.031734 seconds and 5 git commands to generate.