diff options
author | kaashoek <kaashoek> | 2006-08-09 16:04:04 +0000 |
---|---|---|
committer | kaashoek <kaashoek> | 2006-08-09 16:04:04 +0000 |
commit | 6fa5ffb56ffdbe5a37bfc04d063fbff2bf929c27 (patch) | |
tree | 7a06e4e145812109fcec97aec32c135632481edf /fs.c | |
parent | 6c0e444fcdf7ba21442513acbc69c7fca9def06b (diff) | |
download | xv6-labs-6fa5ffb56ffdbe5a37bfc04d063fbff2bf929c27.tar.gz xv6-labs-6fa5ffb56ffdbe5a37bfc04d063fbff2bf929c27.tar.bz2 xv6-labs-6fa5ffb56ffdbe5a37bfc04d063fbff2bf929c27.zip |
devsw
checkpoint: write(fd,"hello\n",6) where fd is a console dev almost works
Diffstat (limited to 'fs.c')
-rw-r--r-- | fs.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -8,6 +8,7 @@ #include "buf.h" #include "fs.h" #include "fsvar.h" +#include "dev.h" // these are inodes currently in use // an entry is free if count == 0 @@ -252,6 +253,16 @@ readi(struct inode *ip, void *xdst, uint off, uint n) return target - n; } +int +writei(struct inode *ip, void *addr, uint n) +{ + if (ip->type == T_DEV) { + return devsw[ip->major].d_write (ip->minor, addr, n); + } else { + panic ("writei: unknown type\n"); + } +} + struct inode * namei(char *path) { |