1 /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
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(5,11,0)) || \
16 LTTNG_KERNEL_RANGE(5,10,220, 5,11,0))
18 struct file
*lttng_lookup_fd_rcu(unsigned int fd
)
20 return lookup_fd_rcu(fd
);
24 struct file
*lttng_lookup_fd_rcu(unsigned int fd
)
30 #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,7,0))
32 int lttng_iterate_fd(struct files_struct
*files
,
34 int (*cb
)(const void *, struct file
*, unsigned int),
40 * iterate_fd() appeared at commit
41 * c3c073f808b22dfae15ef8412b6f7b998644139a in the Linux kernel (first
42 * released kernel: v3.7).
44 #define lttng_iterate_fd iterate_fd
48 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0))
50 static inline bool lttng_close_on_exec(int fd
, const struct fdtable
*fdt
)
52 return close_on_exec(fd
, fdt
);
57 static inline bool lttng_close_on_exec(int fd
, const struct fdtable
*fdt
)
59 return FD_ISSET(fd
, fdt
->close_on_exec
);
64 #endif /* _LTTNG_WRAPPER_FDTABLE_H */
This page took 0.02996 seconds and 4 git commands to generate.