diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h index f26c9f8e..2650929e 100644 --- a/include/sys/ioctl.h +++ b/include/sys/ioctl.h @@ -29,6 +29,7 @@ #define TCGETS 0x5401 #define TCGETA 0x5405 int ioctl (int fd, unsigned long request, ...); +int ioctl3 (int fd, unsigned long request, long data); #endif // ! SYSTEM_LIBC diff --git a/lib/linux/ioctl.c b/lib/linux/ioctl.c index 5e45c8c7..7df28a0b 100644 --- a/lib/linux/ioctl.c +++ b/lib/linux/ioctl.c @@ -33,3 +33,10 @@ ioctl (int filedes, unsigned long command, ...) va_end (ap); return r; } + +int +ioctl3 (int filedes, unsigned long command, long data) +{ + int r = _sys_call3 (SYS_ioctl, filedes, command, data); + return r; +} diff --git a/lib/posix/isatty.c b/lib/posix/isatty.c index db2319ec..cf983f6c 100644 --- a/lib/posix/isatty.c +++ b/lib/posix/isatty.c @@ -58,7 +58,7 @@ int __tcgetattr (int filedes, struct termios *termios_p) { struct ktermios kernel_termios; - int r = ioctl (filedes, TCGETS, &kernel_termios); + int r = ioctl3 (filedes, TCGETS, (long) &kernel_termios); termios_p->c_iflag = kernel_termios.c_iflag; termios_p->c_oflag = kernel_termios.c_oflag;