diff options
author | Anton Kling <anton@kling.gg> | 2023-11-25 18:55:36 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-11-25 18:55:36 +0100 |
commit | 89dc5dd5ba1e9cfe7a8975086c1d5638f8fbbac5 (patch) | |
tree | af8e00b5a6f33e7ab30037d0b949296d816a76a0 /kernel | |
parent | d73f70a656e66b3014bc669a5f82434fb96f5e95 (diff) |
Kernel: Add stat syscall
forgot to add it before
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/syscalls/stat.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/syscalls/stat.c b/kernel/syscalls/stat.c index 103ac34..c430725 100644 --- a/kernel/syscalls/stat.c +++ b/kernel/syscalls/stat.c @@ -6,6 +6,8 @@ int syscall_stat(SYS_STAT_PARAMS *args) { const char *pathname = copy_and_allocate_user_string(args->pathname); struct stat *statbuf = args->statbuf; int fd = vfs_open(pathname, O_READ, 0); + if(0 > fd) + return -ENOENT; int rc = vfs_fstat(fd, statbuf); vfs_close(fd); return rc; |