diff options
Diffstat (limited to 'kernel/syscalls/isatty.c')
-rw-r--r-- | kernel/syscalls/isatty.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/syscalls/isatty.c b/kernel/syscalls/isatty.c new file mode 100644 index 0000000..64649e2 --- /dev/null +++ b/kernel/syscalls/isatty.c @@ -0,0 +1,12 @@ +#include <fs/vfs.h> +#include <syscalls.h> +#include <errno.h> + +int syscall_isatty(int fd) { + vfs_fd_t *fd_ptr = get_vfs_fd(fd); + if (!fd_ptr) + return -EBADF; + if (!fd_ptr->is_tty) + return -ENOTTY; + return 1; +} |