diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-18 13:09:28 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-18 13:09:28 +0200 |
commit | f56aa2f7e4b8e6430e123f714507032a33955a09 (patch) | |
tree | 0381e4cbff6e5e856a3218d811da22fa12c97fcf /src/kernel/vfs | |
parent | f3e03796652b792bb3fd5d3d25b687b9a7f14633 (diff) | |
download | TCE-f56aa2f7e4b8e6430e123f714507032a33955a09.tar.gz TCE-f56aa2f7e4b8e6430e123f714507032a33955a09.zip |
The keyboard handling, it's getting better. + Funny screenshot.
Diffstat (limited to 'src/kernel/vfs')
-rw-r--r-- | src/kernel/vfs/node.cpp | 7 | ||||
-rw-r--r-- | src/kernel/vfs/node.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/kernel/vfs/node.cpp b/src/kernel/vfs/node.cpp index e174bd6..08c7817 100644 --- a/src/kernel/vfs/node.cpp +++ b/src/kernel/vfs/node.cpp @@ -2,7 +2,6 @@ #include "vdir.h" int node::open(process *proc, int mode) { - //TODO : permission checks return 0; // ok } @@ -62,6 +61,7 @@ static FILE i_open(node* r, char* filename, int mode) { node* f = vfs_find(r, filename); if (f == 0) return E_NOT_FOUND; //TODO : different actions depending on open mode + //TODO : permission checks int e = f->open(current_process, mode); if (e != 0) return e; return current_process->fd.add(f); @@ -118,5 +118,8 @@ int write(FILE file, size_t offset, size_t len, char* buffer) { } int link(char* from, char* to, int mode) { - return E_NOT_IMPLEMENTED; + node *f1 = vfs_find(root, from); + if (f1 == 0) return E_NOT_FOUND; + node *f2 = (to == 0 ? 0 : vfs_find(root, to)); + return f1->link(f2, mode); } diff --git a/src/kernel/vfs/node.h b/src/kernel/vfs/node.h index 9005d55..b0ade41 100644 --- a/src/kernel/vfs/node.h +++ b/src/kernel/vfs/node.h @@ -7,6 +7,7 @@ #include <task/task.h> class display; +class vt; class node { public: @@ -25,9 +26,11 @@ class node { virtual node* get_child(char* name) { return 0; } virtual int add_child(char* name, node *child) { return E_NOT_IMPLEMENTED; } virtual size_t get_size() { return 0; } + virtual int link(node* other, int mode) { return E_NOT_IMPLEMENTED; } // kind of like dynamic_cast'int these things virtual display *as_display() { return 0; } + virtual vt *as_vt() { return 0; } }; void vfs_setup(); |