summaryrefslogtreecommitdiff
path: root/src/kernel/fd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/fd.c')
-rw-r--r--src/kernel/fd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kernel/fd.c b/src/kernel/fd.c
index 810cdb7..e875061 100644
--- a/src/kernel/fd.c
+++ b/src/kernel/fd.c
@@ -24,6 +24,16 @@ static int fdop_special_tty(struct fdop_args *args) {
case FDOP_MOUNT:
return 0; // no special action needed
+ case FDOP_OPEN:
+ /* don't allow anything after the mount point
+ * this is a file, not a directory
+ * for example: open("/tty") is allowed. open("/tty/smth") isn't */
+ if (args->open.len == 0) {
+ args->open.target->type = FD_SPECIAL_TTY;
+ return 0;
+ }
+ return -1;
+
case FDOP_READ:
return -1; // input not implemented yet