diff --git a/fs/vfs/src/dispatch.c b/fs/vfs/src/dispatch.c index 5c8a4dd..bba9adb 100644 --- a/fs/vfs/src/dispatch.c +++ b/fs/vfs/src/dispatch.c @@ -113,6 +113,18 @@ void vfsDispatchReaddir(SyscallHeader *hdr) { } } +void vfsDispatchMmap(SyscallHeader *hdr) { + MmapCommand *cmd = (MmapCommand *) hdr; + char type[32]; + if(resolve(cmd->path, type, cmd->device, cmd->path)) { + int sd = findFSServer(type); + if(sd <= 0) luxLogf(KPRINT_LEVEL_WARNING, "no file system driver loaded for '%s'\n", type); + else luxSend(sd, cmd); + } else { + luxLogf(KPRINT_LEVEL_WARNING, "could not resolve path '%s'\n", cmd->path); + } +} + void (*vfsDispatchTable[])(SyscallHeader *) = { vfsDispatchStat, // 0 - stat() NULL, // 1 - flush() @@ -132,6 +144,6 @@ void (*vfsDispatchTable[])(SyscallHeader *) = { NULL, NULL, NULL, // 15, 16, 17 - irrelevant to vfs - NULL, // 18 - mmap() + vfsDispatchMmap, // 18 - mmap() NULL, // 19 - msync() }; \ No newline at end of file