1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef __LINUX_FILE_H
13 #define __LINUX_FILE_H
15 #include <asm/atomic.h>
16 #include <linux/posix_types.h>
17 #include <linux/compiler.h>
18 #include <linux/spinlock.h>
19 #include <linux/rcupdate.h>
20 #include <linux/types.h>
22 #define NR_OPEN_DEFAULT BITS_PER_LONG
24 struct embedded_fd_set {
25 unsigned long fds_bits[1];
28 #define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set))
34 fd_set *close_on_exec;
37 struct files_struct *free_files;
47 spinlock_t file_lock ____cacheline_aligned_in_smp;
49 struct embedded_fd_set close_on_exec_init;
50 struct embedded_fd_set open_fds_init;
51 struct file * fd_array[NR_OPEN_DEFAULT];
54 #define files_fdtable(files) (rcu_dereference((files)->fdt))
58 #define fcheck(fd) fcheck_files(current->files, fd)
62 struct files_struct *get_files_struct(struct task_struct *);