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

int syscall_isatty(int fd) {
  vfs_fd_t *fd_ptr = get_vfs_fd(fd, NULL);
  if (!fd_ptr) {
    return -EBADF;
  }
  if (!fd_ptr->is_tty) {
    return -ENOTTY;
  }
  return 1;
}