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:
parent
11798d4272
commit
5480c133ae
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue