mescc: Mes C Library: Fix isatty for x86_64.

* lib/linux/ioctl.c (ioctl3): New function.
* include/sys/ioctl.h: Declare it.
* lib/posix/isatty.c (__tcgetattr): Use it.
This commit is contained in:
Jan Nieuwenhuizen 2019-11-23 21:29:36 +01:00
parent 11798d4272
commit 5480c133ae
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
3 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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;
}

View file

@ -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;