blob: 552768eb51c82538843a110a976a3e5c22617d8d [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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 ***
Ben Cheng654325d2012-03-07 21:13:49 -080010 *** 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 ***
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017 ****************************************************************************
18 ****************************************************************************/
19#ifndef __LINUX_FILE_H
20#define __LINUX_FILE_H
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#include <asm/atomic.h>
22#include <linux/posix_types.h>
Ben Cheng654325d2012-03-07 21:13:49 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024#include <linux/compiler.h>
25#include <linux/spinlock.h>
26#include <linux/rcupdate.h>
27#include <linux/types.h>
Ben Cheng654325d2012-03-07 21:13:49 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029#define NR_OPEN_DEFAULT BITS_PER_LONG
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080030struct embedded_fd_set {
31 unsigned long fds_bits[1];
32};
Ben Cheng654325d2012-03-07 21:13:49 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035struct fdtable {
36 unsigned int max_fds;
37 int max_fdset;
Ben Cheng654325d2012-03-07 21:13:49 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039 struct file ** fd;
40 fd_set *close_on_exec;
41 fd_set *open_fds;
42 struct rcu_head rcu;
Ben Cheng654325d2012-03-07 21:13:49 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044 struct files_struct *free_files;
45 struct fdtable *next;
46};
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080047struct files_struct {
Ben Cheng654325d2012-03-07 21:13:49 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049 atomic_t count;
50 struct fdtable *fdt;
51 struct fdtable fdtab;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080052 spinlock_t file_lock ____cacheline_aligned_in_smp;
Ben Cheng654325d2012-03-07 21:13:49 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080054 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];
Ben Cheng654325d2012-03-07 21:13:49 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080059};
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080060#define files_fdtable(files) (rcu_dereference((files)->fdt))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080061struct kmem_cache;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080062#define fcheck(fd) fcheck_files(current->files, fd)
Ben Cheng654325d2012-03-07 21:13:49 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080064struct task_struct;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080065struct files_struct *get_files_struct(struct task_struct *);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080066#endif