From 6fa5ffb56ffdbe5a37bfc04d063fbff2bf929c27 Mon Sep 17 00:00:00 2001 From: kaashoek Date: Wed, 9 Aug 2006 16:04:04 +0000 Subject: devsw checkpoint: write(fd,"hello\n",6) where fd is a console dev almost works --- fs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'fs.c') diff --git a/fs.c b/fs.c index cf530a9..d921221 100644 --- a/fs.c +++ b/fs.c @@ -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) { -- cgit v1.2.3