diff --git a/kernel/syscall.c b/kernel/syscall.c index bff2f279..8cee87e6 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -76,7 +76,9 @@ static int sys_lseek(int fd, off_t pos, int origin) { int ret = -EINVAL; - /* Beware: still not checking the filetype & size*/ + if (BUILTIN_EXPECT(per_core(current_task)->fildes_table[fd].node->type != FS_FILE, 0)) + return -EINVAL; + switch(origin) {