summaryrefslogtreecommitdiff
path: root/libc/termios
diff options
context:
space:
mode:
Diffstat (limited to 'libc/termios')
-rw-r--r--libc/termios/tcgetattr.c4
-rw-r--r--libc/termios/tcgetsid.c3
-rw-r--r--libc/termios/tcsetattr.c3
-rw-r--r--libc/termios/termios.c23
-rw-r--r--libc/termios/ttyname.c17
5 files changed, 32 insertions, 18 deletions
diff --git a/libc/termios/tcgetattr.c b/libc/termios/tcgetattr.c
index 1f1f0562b..8a9448bd7 100644
--- a/libc/termios/tcgetattr.c
+++ b/libc/termios/tcgetattr.c
@@ -32,7 +32,7 @@
#include "kernel_termios.h"
/* Put the state of FD into *TERMIOS_P. */
-int tcgetattr (int fd, struct termios *termios_p)
+int attribute_hidden __tcgetattr (int fd, struct termios *termios_p)
{
struct __kernel_termios k_termios;
int retval;
@@ -75,4 +75,4 @@ int tcgetattr (int fd, struct termios *termios_p)
return retval;
}
-
+strong_alias(__tcgetattr,tcgetattr)
diff --git a/libc/termios/tcgetsid.c b/libc/termios/tcgetsid.c
index 5e4addece..54d317724 100644
--- a/libc/termios/tcgetsid.c
+++ b/libc/termios/tcgetsid.c
@@ -16,6 +16,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#define getsid __getsid
+#define tcgetpgrp __tcgetpgrp
+
#include <errno.h>
#include <termios.h>
#include <sys/ioctl.h>
diff --git a/libc/termios/tcsetattr.c b/libc/termios/tcsetattr.c
index 76d73796e..2bf2d2a29 100644
--- a/libc/termios/tcsetattr.c
+++ b/libc/termios/tcsetattr.c
@@ -47,7 +47,7 @@
/* Set the state of FD to *TERMIOS_P. */
-int tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
+int attribute_hidden __tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
{
struct __kernel_termios k_termios;
unsigned long int cmd;
@@ -114,3 +114,4 @@ int tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
return retval;
}
+strong_alias(__tcsetattr,tcsetattr)
diff --git a/libc/termios/termios.c b/libc/termios/termios.c
index cf3bd9bc6..dc0372fa3 100644
--- a/libc/termios/termios.c
+++ b/libc/termios/termios.c
@@ -23,6 +23,8 @@
much more current.
*/
+#define tcgetattr __tcgetattr
+
#include <errno.h>
#include <stddef.h>
#include <sys/ioctl.h>
@@ -100,7 +102,7 @@ int tcsetpgrp ( int fd, pid_t pgrp_id)
#ifdef L_tcgetpgrp
/* Return the foreground process group ID of FD. */
-pid_t tcgetpgrp ( int fd)
+pid_t attribute_hidden __tcgetpgrp ( int fd)
{
int pgrp;
@@ -108,6 +110,7 @@ pid_t tcgetpgrp ( int fd)
return (pid_t) -1;
return (pid_t) pgrp;
}
+strong_alias(__tcgetpgrp,tcgetpgrp)
#endif
/* This is a gross hack around a kernel bug. If the cfsetispeed functions is
@@ -143,7 +146,7 @@ speed_t cfgetispeed (const struct termios *termios_p)
#ifdef L_cfsetospeed
/* Set the output baud rate stored in *TERMIOS_P to SPEED. */
-int cfsetospeed (struct termios *termios_p, speed_t speed)
+int attribute_hidden __cfsetospeed (struct termios *termios_p, speed_t speed)
{
if ((speed & ~CBAUD) != 0
&& (speed < B57600 || speed > B460800))
@@ -157,6 +160,7 @@ int cfsetospeed (struct termios *termios_p, speed_t speed)
return 0;
}
+strong_alias(__cfsetospeed,cfsetospeed)
#endif
#ifdef L_cfsetispeed
@@ -164,7 +168,7 @@ int cfsetospeed (struct termios *termios_p, speed_t speed)
* Although for Linux there is no difference between input and output
* speed, the numerical 0 is a special case for the input baud rate. It
* should set the input baud rate to the output baud rate. */
-int cfsetispeed ( struct termios *termios_p, speed_t speed)
+int attribute_hidden __cfsetispeed ( struct termios *termios_p, speed_t speed)
{
if ((speed & ~CBAUD) != 0
&& (speed < B57600 || speed > B460800))
@@ -184,9 +188,14 @@ int cfsetispeed ( struct termios *termios_p, speed_t speed)
return 0;
}
+strong_alias(__cfsetispeed,cfsetispeed)
#endif
#ifdef L_cfsetspeed
+
+extern int __cfsetospeed (struct termios *__termios_p, speed_t __speed) __THROW attribute_hidden;
+extern int __cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW attribute_hidden;
+
struct speed_struct
{
speed_t value;
@@ -278,14 +287,14 @@ int cfsetspeed (struct termios *termios_p, speed_t speed)
for (cnt = 0; cnt < sizeof (speeds) / sizeof (speeds[0]); ++cnt)
if (speed == speeds[cnt].internal)
{
- cfsetispeed (termios_p, speed);
- cfsetospeed (termios_p, speed);
+ __cfsetispeed (termios_p, speed);
+ __cfsetospeed (termios_p, speed);
return 0;
}
else if (speed == speeds[cnt].value)
{
- cfsetispeed (termios_p, speeds[cnt].internal);
- cfsetospeed (termios_p, speeds[cnt].internal);
+ __cfsetispeed (termios_p, speeds[cnt].internal);
+ __cfsetospeed (termios_p, speeds[cnt].internal);
return 0;
}
diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c
index 15093f8a5..43005a63a 100644
--- a/libc/termios/ttyname.c
+++ b/libc/termios/ttyname.c
@@ -26,13 +26,6 @@
*/
#define TTYNAME_BUFLEN 32
-char *ttyname(int fd)
-{
- static char name[TTYNAME_BUFLEN];
-
- return ttyname_r(fd, name, TTYNAME_BUFLEN) ? NULL : name;
-}
-
static const char dirlist[] =
/* 12345670123 */
"\010/dev/vc/\0" /* Try /dev/vc first (be devfs compatible) */
@@ -41,7 +34,7 @@ static const char dirlist[] =
"\011/dev/pts/\0" /* and try /dev/pts next */
"\005/dev/\0"; /* and try walking through /dev last */
-int ttyname_r(int fd, char *ubuf, size_t ubuflen)
+int attribute_hidden __ttyname_r(int fd, char *ubuf, size_t ubuflen)
{
struct dirent *d;
struct stat st;
@@ -116,3 +109,11 @@ int ttyname_r(int fd, char *ubuf, size_t ubuflen)
return rv;
}
+strong_alias(__ttyname_r,ttyname_r)
+
+char *ttyname(int fd)
+{
+ static char name[TTYNAME_BUFLEN];
+
+ return __ttyname_r(fd, name, TTYNAME_BUFLEN) ? NULL : name;
+}