1 /**************************************************************************** 2 **************************************************************************** 3 *** 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. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef __LINUX_FILE_H 20 #define __LINUX_FILE_H 21 #include <asm/atomic.h> 22 #include <linux/posix_types.h> 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #include <linux/compiler.h> 25 #include <linux/spinlock.h> 26 #include <linux/rcupdate.h> 27 #include <linux/types.h> 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #define NR_OPEN_DEFAULT BITS_PER_LONG 30 struct embedded_fd_set { 31 unsigned long fds_bits[1]; 32 }; 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 #define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set)) 35 struct fdtable { 36 unsigned int max_fds; 37 int max_fdset; 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 struct file ** fd; 40 fd_set *close_on_exec; 41 fd_set *open_fds; 42 struct rcu_head rcu; 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 struct files_struct *free_files; 45 struct fdtable *next; 46 }; 47 struct files_struct { 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 atomic_t count; 50 struct fdtable *fdt; 51 struct fdtable fdtab; 52 spinlock_t file_lock ____cacheline_aligned_in_smp; 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 int next_fd; 55 struct embedded_fd_set close_on_exec_init; 56 struct embedded_fd_set open_fds_init; 57 struct file * fd_array[NR_OPEN_DEFAULT]; 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 }; 60 #define files_fdtable(files) (rcu_dereference((files)->fdt)) 61 struct kmem_cache; 62 #define fcheck(fd) fcheck_files(current->files, fd) 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 struct task_struct; 65 struct files_struct *get_files_struct(struct task_struct *); 66 #endif 67