}
#endif
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,10,0))
+static inline
+bool lttng_close_on_exec(unsigned int fd, const struct files_struct *files)
+{
+ return close_on_exec(fd, files);
+}
+#else
+static inline
+bool lttng_close_on_exec(unsigned int fd, const struct files_struct *files)
+{
+ return close_on_exec(fd, files_fdtable(files));
+}
+#endif
+
#endif /* _LTTNG_WRAPPER_FDTABLE_H */
#include <wrapper/fdtable.h>
#include <wrapper/tracepoint.h>
#include <wrapper/blkdev.h>
-#include <wrapper/fdtable.h>
#include <wrapper/sched.h>
/* Define the tracepoints, but do not build the probes */
* the lock is taken, but we are not aware whether this is
* guaranteed or not, so play safe.
*/
- if (fd < fdt->max_fds && close_on_exec(fd, fdt))
+ if (fd < fdt->max_fds && lttng_close_on_exec(fd, ctx->files))
flags |= O_CLOEXEC;
if (IS_ERR(s)) {
struct dentry *dentry = file->f_path.dentry;