diff options
author | rsc <rsc> | 2006-09-07 14:28:12 +0000 |
---|---|---|
committer | rsc <rsc> | 2006-09-07 14:28:12 +0000 |
commit | bb207a1d42c9a75a64af35de4f12912176ebfc8d (patch) | |
tree | b762f80b034299b64d60d574f6eb23f6c7478068 /file.c | |
parent | 52253dce6581ab381091720d3df9f3037ce38f7b (diff) | |
download | xv6-labs-bb207a1d42c9a75a64af35de4f12912176ebfc8d.tar.gz xv6-labs-bb207a1d42c9a75a64af35de4f12912176ebfc8d.tar.bz2 xv6-labs-bb207a1d42c9a75a64af35de4f12912176ebfc8d.zip |
comments
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -41,8 +41,7 @@ filealloc(void) return 0; } -// Write to file descriptor; -// addr is a kernel address, pointing into some process's p->mem. +// Write to file f. Addr is kernel address. int filewrite(struct file *fd, char *addr, int n) { @@ -64,7 +63,7 @@ filewrite(struct file *fd, char *addr, int n) } } -// Read from file descriptor. +// Read from file f. Addr is kernel address. int fileread(struct file *fd, char *addr, int n) { @@ -85,7 +84,7 @@ fileread(struct file *fd, char *addr, int n) } } -// Close file descriptor. +// Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *fd) { @@ -113,7 +112,7 @@ fileclose(struct file *fd) } } -// Get metadata about file descriptor. +// Get metadata about file f. int filestat(struct file *fd, struct stat *st) { @@ -126,7 +125,7 @@ filestat(struct file *fd, struct stat *st) return -1; } -// Increment file descriptor reference count. +// Increment ref count for file f. void fileincref(struct file *fd) { |