summaryrefslogtreecommitdiff
path: root/src/kernel/vfs
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/vfs')
-rw-r--r--src/kernel/vfs/node.cpp6
-rw-r--r--src/kernel/vfs/node.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/vfs/node.cpp b/src/kernel/vfs/node.cpp
index 0b753af..d5d4c65 100644
--- a/src/kernel/vfs/node.cpp
+++ b/src/kernel/vfs/node.cpp
@@ -126,3 +126,9 @@ int link(char* from, char* to, int mode) {
node *f2 = (to == 0 ? 0 : vfs_find(root, to));
return f1->link(f2, mode);
}
+
+int dev_control(FILE file, char *data) {
+ node *f = vfs_read_fd(file);
+ if (f == 0) return E_INVALID_FD;
+ return f->dev_control(data);
+}
diff --git a/src/kernel/vfs/node.h b/src/kernel/vfs/node.h
index 3b1c700..7fbc205 100644
--- a/src/kernel/vfs/node.h
+++ b/src/kernel/vfs/node.h
@@ -28,6 +28,7 @@ class node {
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; }
+ virtual int dev_control(char *data) { return E_NOT_IMPLEMENTED; }
// kind of like dynamic_cast'ing these things
virtual display *as_display() { return 0; }
@@ -51,5 +52,6 @@ void close(FILE file);
int read(FILE file, size_t offset, size_t len, char *buffer);
int write(FILE file, size_t offset, size_t len, char *buffer);
int link(char* from, char* to, int mode);
+int dev_control(FILE file, char *data);
#endif