summaryrefslogtreecommitdiff
path: root/kernel/syscalls/fstat.c
blob: 38346e31b83e02f680257ba0962a6a539941d294 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <errno.h>
#include <fs/vfs.h>
#include <syscalls.h>

int syscall_fstat(int fd, struct stat *buf) {
  if (!mmu_is_valid_userpointer(buf, sizeof(struct stat))) {
    return -EPERM; // TODO: Is this correct? The spec says nothing about
                   // this case.
  }
  return vfs_fstat(fd, buf);
}