1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
4 * Copyright (C) 2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 #include <linux/version.h>
8 #include <linux/spinlock.h>
9 #include <wrapper/fdtable.h>
11 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
14 * Reimplementation of iterate_fd() for kernels between 2.6.32 and 3.6
17 int lttng_iterate_fd(struct files_struct
*files
,
19 int (*cb
)(const void *, struct file
*, unsigned int),
29 spin_lock(&files
->file_lock
);
30 fdt
= files_fdtable(files
);
31 for (i
= 0; i
< fdt
->max_fds
; i
++) {
32 filp
= fcheck_files(files
, i
);
35 res
= cb(ctx
, filp
, i
);
39 spin_unlock(&files
->file_lock
);
This page took 0.049345 seconds and 4 git commands to generate.