Remove __isatty() system call

This commit is contained in:
Mark
2020-01-20 16:58:14 +02:00
parent f6c8c2b941
commit 7d962ff208
4 changed files with 0 additions and 31 deletions
-3
View File
@@ -36,6 +36,3 @@ int sys_chown(const char *path, uid_t uid, gid_t gid);
off_t sys_lseek(int fd, off_t offset, int whence);
int sys_ioctl(int fd, unsigned int cmd, void *arg);
// XXX: Will be removed once ioctl(fd, TCGETS, ...) is possible
int sys_isatty(int fd);
-1
View File
@@ -18,7 +18,6 @@
#define SYSCALL_NR_READDIR 89
#define SYSCALL_NR_CHMOD 90
#define SYSCALL_NR_CHOWN 92
#define SYSCALL_NRX_ISATTY 248
#define SYSCALL_NR_BRK 12
#define SYSCALL_NR_NANOSLEEP 35
-26
View File
@@ -306,29 +306,3 @@ int sys_ioctl(int fd, unsigned int cmd, void *arg) {
return vfs_ioctl(&thr->ioctx, of, cmd, arg);
}
int sys_isatty(int fd) {
struct thread *thr = get_cpu()->thread;
struct ofile *of;
_assert(thr);
if (fd < 0 || fd >= THREAD_MAX_FDS) {
return -EBADF;
}
if (!(of = thr->fds[fd])) {
return -EBADF;
}
_assert(of->vnode);
if (of->vnode->type == VN_CHR) {
struct chrdev *chr = of->vnode->dev;
_assert(chr);
// TODO: somehow check that this is a tty
// via flags
return 1;
}
return -ENOTTY;
}
-1
View File
@@ -31,7 +31,6 @@ const void *amd64_syscall_jmp_table[256] = {
[SYSCALL_NR_RMDIR] = sys_rmdir,
[SYSCALL_NR_CHMOD] = sys_chmod,
[SYSCALL_NR_CHOWN] = sys_chown,
[SYSCALL_NRX_ISATTY] = sys_isatty,
// Process
[SYSCALL_NR_EXIT] = sys_exit,