struct_IO_FILE;typedefstruct_IO_FILEFILE;struct_IO_FILE{int_flags;/* High-order word is _IO_MAGIC; rest is flags. *//* The following pointers correspond to the C++ streambuf protocol. */char*_IO_read_ptr;/* Current read pointer */char*_IO_read_end;/* End of get area. */char*_IO_read_base;/* Start of putback+get area. */char*_IO_write_base;/* Start of put area. */char*_IO_write_ptr;/* Current put pointer. */char*_IO_write_end;/* End of put area. */char*_IO_buf_base;/* Start of reserve area. */char*_IO_buf_end;/* End of reserve area. *//* The following fields are used to support backing up and undo. */char*_IO_save_base;/* Pointer to start of non-current get area. */char*_IO_backup_base;/* Pointer to first valid character of backup area */char*_IO_save_end;/* Pointer to end of non-current get area. */struct_IO_marker*_markers;struct_IO_FILE*_chain;int_fileno;int_flags2;__off_t_old_offset;/* This used to be _offset but it's too small. *//* 1+column number of pbase(); 0 is unknown. */unsignedshort_cur_column;signedchar_vtable_offset;char_shortbuf[1];_IO_lock_t*_lock;__off64_t_offset;/* Wide character stream stuff. */struct_IO_codecvt*_codecvt;struct_IO_wide_data*_wide_data;//......
int_mode;/* Make sure we don't get into trouble again. */// 最后这个成员_unused2比较有意思, 给的解释是这个成员可以保证不会再出错.
char_unused2[15*sizeof(int)-4*sizeof(void*)-sizeof(size_t)];};
struct_IO_wide_data{wchar_t*_IO_read_ptr;/* Current read pointer */wchar_t*_IO_read_end;/* End of get area. */wchar_t*_IO_read_base;/* Start of putback+get area. */wchar_t*_IO_write_base;/* Start of put area. */wchar_t*_IO_write_ptr;/* Current put pointer. */wchar_t*_IO_write_end;/* End of put area. */wchar_t*_IO_buf_base;/* Start of reserve area. */wchar_t*_IO_buf_end;/* End of reserve area. *//* The following fields are used to support backing up and undo. */wchar_t*_IO_save_base;/* Pointer to start of non-current get area. */wchar_t*_IO_backup_base;/* Pointer to first valid character of
backup area */wchar_t*_IO_save_end;/* Pointer to end of non-current get area. */__mbstate_t_IO_state;__mbstate_t_IO_last_state;struct_IO_codecvt_codecvt;wchar_t_shortbuf[1];conststruct_IO_jump_t*_wide_vtable;};
structfile{union{structllist_nodefu_llist;structrcu_headfu_rcuhead;}f_u;structpathf_path;structinode*f_inode;/* cached value */conststructfile_operations*f_op;/*
* Protects f_ep_links, f_flags.
* Must not be taken from IRQ context.
*/spinlock_tf_lock;enumrw_hintf_write_hint;atomic_long_tf_count;unsignedintf_flags;fmode_tf_mode;structmutexf_pos_lock;loff_tf_pos;structfown_structf_owner;conststructcred*f_cred;structfile_ra_statef_ra;u64f_version;#ifdef CONFIG_SECURITY
void*f_security;#endif
/* needed for tty driver, and maybe others */void*private_data;#ifdef CONFIG_EPOLL
/* Used by fs/eventpoll.c to link all the hooks to this file */structlist_headf_ep_links;structlist_headf_tfile_llink;#endif /* #ifdef CONFIG_EPOLL */structaddress_space*f_mapping;errseq_tf_wb_err;}__randomize_layout__attribute__((aligned(4)));/* lest something weird decides that 2 is OK */