diff options
Diffstat (limited to 'libc/termios')
-rw-r--r-- | libc/termios/tcgetattr.c | 2 | ||||
-rw-r--r-- | libc/termios/tcgetsid.c | 2 | ||||
-rw-r--r-- | libc/termios/tcsetattr.c | 4 | ||||
-rw-r--r-- | libc/termios/termios.c | 17 | ||||
-rw-r--r-- | libc/termios/ttyname.c | 4 |
5 files changed, 17 insertions, 12 deletions
diff --git a/libc/termios/tcgetattr.c b/libc/termios/tcgetattr.c index 8a9448bd7..3fd6d29d6 100644 --- a/libc/termios/tcgetattr.c +++ b/libc/termios/tcgetattr.c @@ -37,7 +37,7 @@ int attribute_hidden __tcgetattr (int fd, struct termios *termios_p) struct __kernel_termios k_termios; int retval; - retval = ioctl (fd, TCGETS, &k_termios); + retval = __ioctl (fd, TCGETS, &k_termios); termios_p->c_iflag = k_termios.c_iflag; termios_p->c_oflag = k_termios.c_oflag; diff --git a/libc/termios/tcgetsid.c b/libc/termios/tcgetsid.c index 54d317724..e4ba87ac5 100644 --- a/libc/termios/tcgetsid.c +++ b/libc/termios/tcgetsid.c @@ -40,7 +40,7 @@ pid_t tcgetsid (int fd) int serrno = errno; int sid; - if (ioctl (fd, TIOCGSID, &sid) < 0) + if (__ioctl (fd, TIOCGSID, &sid) < 0) { if (errno == EINVAL) { diff --git a/libc/termios/tcsetattr.c b/libc/termios/tcsetattr.c index 2bf2d2a29..3afa1012c 100644 --- a/libc/termios/tcsetattr.c +++ b/libc/termios/tcsetattr.c @@ -83,14 +83,14 @@ int attribute_hidden __tcsetattr (int fd, int optional_actions, const struct ter __memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0], __KERNEL_NCCS * sizeof (cc_t)); - retval = ioctl (fd, cmd, &k_termios); + retval = __ioctl (fd, cmd, &k_termios); if (retval == 0 && cmd == TCSETS) { /* The Linux kernel has a bug which silently ignore the invalid c_cflag on pty. We have to check it here. */ int save = errno; - retval = ioctl (fd, TCGETS, &k_termios); + retval = __ioctl (fd, TCGETS, &k_termios); if (retval) { /* We cannot verify if the setting is ok. We don't return diff --git a/libc/termios/termios.c b/libc/termios/termios.c index dc0372fa3..680796e16 100644 --- a/libc/termios/termios.c +++ b/libc/termios/termios.c @@ -35,11 +35,12 @@ #ifdef L_isatty /* Return 1 if FD is a terminal, 0 if not. */ -int isatty(int fd) +int attribute_hidden __isatty(int fd) { struct termios term; return (tcgetattr (fd, &term) == 0); } +strong_alias(__isatty,isatty) #endif #ifdef L_tcdrain @@ -47,7 +48,7 @@ int isatty(int fd) int __libc_tcdrain (int fd) { /* With an argument of 1, TCSBRK waits for the output to drain. */ - return ioctl(fd, TCSBRK, 1); + return __ioctl(fd, TCSBRK, 1); } weak_alias(__libc_tcdrain, tcdrain) #endif @@ -56,7 +57,7 @@ weak_alias(__libc_tcdrain, tcdrain) /* Suspend or restart transmission on FD. */ int tcflow ( int fd, int action) { - return ioctl(fd, TCXONC, action); + return __ioctl(fd, TCXONC, action); } #endif @@ -64,7 +65,7 @@ int tcflow ( int fd, int action) /* Flush pending data on FD. */ int tcflush ( int fd, int queue_selector) { - return ioctl(fd, TCFLSH, queue_selector); + return __ioctl(fd, TCFLSH, queue_selector); } #endif @@ -76,12 +77,12 @@ int tcsendbreak( int fd, int duration) and an implementation-defined period if DURATION is nonzero. We define a positive DURATION to be number of milliseconds to break. */ if (duration <= 0) - return ioctl(fd, TCSBRK, 0); + return __ioctl(fd, TCSBRK, 0); #ifdef TCSBRKP /* Probably Linux-specific: a positive third TCSBRKP ioctl argument is defined to be the number of 100ms units to break. */ - return ioctl(fd, TCSBRKP, (duration + 99) / 100); + return __ioctl(fd, TCSBRKP, (duration + 99) / 100); #else /* ioctl can't send a break of any other duration for us. This could be changed to use trickery (e.g. lower speed and @@ -96,7 +97,7 @@ int tcsendbreak( int fd, int duration) /* Set the foreground process group ID of FD set PGRP_ID. */ int tcsetpgrp ( int fd, pid_t pgrp_id) { - return ioctl (fd, TIOCSPGRP, &pgrp_id); + return __ioctl (fd, TIOCSPGRP, &pgrp_id); } #endif @@ -106,7 +107,7 @@ pid_t attribute_hidden __tcgetpgrp ( int fd) { int pgrp; - if (ioctl (fd, TIOCGPGRP, &pgrp) < 0) + if (__ioctl (fd, TIOCGPGRP, &pgrp) < 0) return (pid_t) -1; return (pid_t) pgrp; } diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c index 43005a63a..5a5d2a225 100644 --- a/libc/termios/ttyname.c +++ b/libc/termios/ttyname.c @@ -1,3 +1,7 @@ +#define opendir __opendir +#define closedir __closedir +#define isatty __isatty + #include <string.h> #include <errno.h> #include <assert.h> |