filp - mathfur/minix GitHub Wiki
呼出元
read_write
概要
- servers/vfs/file.hにて定義
- ファイルポジション、モードを持つ
- ロックが出来る
実装
EXTERN struct filp {
mode_t filp_mode; /* ビット列。ファイルの開き方? */
u64_t filp_pos; /* file position */
int filp_flags; /* flags from open and fcntl */
int filp_state; /* state for crash recovery */
int filp_count; /* ファイルディスクリプタ何個が使用しているか? */
struct vnode *filp_vno; /* vnode belonging to this file */
mutex_t filp_lock; /* lock to gain exclusive access */
struct fproc *filp_softlock; /* if not NULL; this filp didn't lock the
* vnode. Another filp already holds a lock
* for this thread */
/* the following fields are for select() and are owned by the generic
* select() code (i.e., fd-type-specific select() code can't touch these).
*/
int filp_selectors; /* select()ing processes blocking on this fd */
int filp_select_ops; /* interested in these SEL_* operations */
int filp_select_flags; /* Select flags for the filp */
/* following are for fd-type-specific select() */
int filp_pipe_select_ops;
} filp[NR_FILPS];
コメント