UNIX xv6 (rev8, 9/1/15)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions | Variables
file.c File Reference
#include "types.h"
#include "defs.h"
#include "param.h"
#include "fs.h"
#include "file.h"
#include "spinlock.h"

Go to the source code of this file.

Functions

void fileinit (void)
 
struct filefilealloc (void)
 
struct filefiledup (struct file *f)
 
void fileclose (struct file *f)
 
int filestat (struct file *f, struct stat *st)
 
int fileread (struct file *f, char *addr, int n)
 
int filewrite (struct file *f, char *addr, int n)
 

Variables

struct devsw devsw [NDEV]
 
struct {
   struct spinlock   lock
 
   struct file   file [NFILE]
 
ftable
 

Function Documentation

struct file* filealloc ( void  )

Definition at line 26 of file file.c.

void fileclose ( struct file f)

Definition at line 56 of file file.c.

struct file* filedup ( struct file f)

Definition at line 44 of file file.c.

void fileinit ( void  )

Definition at line 19 of file file.c.

int fileread ( struct file f,
char *  addr,
int  n 
)

Definition at line 96 of file file.c.

int filestat ( struct file f,
struct stat st 
)

Definition at line 83 of file file.c.

int filewrite ( struct file f,
char *  addr,
int  n 
)

Definition at line 117 of file file.c.

Variable Documentation

struct devsw devsw[NDEV]

Definition at line 12 of file file.c.

struct file file[NFILE]

Definition at line 15 of file file.c.

struct { ... } ftable
struct spinlock lock

Definition at line 14 of file file.c.