aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2025-06-11 18:35:32 -0700
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-06-17 09:11:38 -0300
commitedf7328db204f243c1bfde90edb11f99c7a13e14 (patch)
tree1fa56a5f642787fa589dcc89e4b7aa395f02106e
parent11649794748f96f6f71446062b4c45c0285591b3 (diff)
downloadglibc-edf7328db204f243c1bfde90edb11f99c7a13e14.zip
glibc-edf7328db204f243c1bfde90edb11f99c7a13e14.tar.gz
glibc-edf7328db204f243c1bfde90edb11f99c7a13e14.tar.bz2
termios: make __tcsetattr() the internal interface
There is a prototype for an internal __tcsetattr() function in include/termios.h, but tcsetattr without __ were still declared as the actual functions. Make this match the comment and make __tcsetattr() an internal interface. This will be required to version struct termios for Linux on MIPS and SPARC. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-rw-r--r--include/termios.h2
-rw-r--r--login/openpty.c2
-rw-r--r--misc/getpass.c4
-rw-r--r--sysdeps/unix/bsd/tcsetattr.c6
-rw-r--r--sysdeps/unix/sysv/linux/tcsetattr.c2
-rw-r--r--termios/tcsetattr.c5
6 files changed, 12 insertions, 9 deletions
diff --git a/include/termios.h b/include/termios.h
index e2c35eb..a79da7a 100644
--- a/include/termios.h
+++ b/include/termios.h
@@ -10,7 +10,7 @@ extern int __tcsetattr (int __fd, int __optional_actions,
extern int __libc_tcdrain (int __fd);
libc_hidden_proto (__tcgetattr)
-libc_hidden_proto (tcsetattr)
+libc_hidden_proto (__tcsetattr)
libc_hidden_proto (cfsetispeed)
libc_hidden_proto (cfsetospeed)
diff --git a/login/openpty.c b/login/openpty.c
index fc45add..f7fd6b7 100644
--- a/login/openpty.c
+++ b/login/openpty.c
@@ -124,7 +124,7 @@ __openpty (int *pptmx, int *pterminal, char *name,
/* XXX Should we ignore errors here? */
if (termp)
- tcsetattr (terminal, TCSAFLUSH, termp);
+ __tcsetattr (terminal, TCSAFLUSH, termp);
#ifdef TIOCSWINSZ
if (winp)
__ioctl (terminal, TIOCSWINSZ, winp);
diff --git a/misc/getpass.c b/misc/getpass.c
index 4fe9453..a68acf4 100644
--- a/misc/getpass.c
+++ b/misc/getpass.c
@@ -83,7 +83,7 @@ getpass (const char *prompt)
s = t;
/* Tricky, tricky. */
t.c_lflag &= ~(ECHO|ISIG);
- tty_changed = (tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &t) == 0);
+ tty_changed = (__tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &t) == 0);
}
else
tty_changed = 0;
@@ -110,7 +110,7 @@ getpass (const char *prompt)
/* Restore the original setting. */
if (tty_changed)
- (void) tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &s);
+ (void) __tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &s);
funlockfile (out);
diff --git a/sysdeps/unix/bsd/tcsetattr.c b/sysdeps/unix/bsd/tcsetattr.c
index 38b5f71..8693d94 100644
--- a/sysdeps/unix/bsd/tcsetattr.c
+++ b/sysdeps/unix/bsd/tcsetattr.c
@@ -32,7 +32,7 @@
/* Set the state of FD to *TERMIOS_P. */
int
-tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
+__tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
{
struct termios myt;
@@ -56,4 +56,6 @@ tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
return __ioctl (fd, TIOCSETAF, termios_p);
}
}
-libc_hidden_def (tcsetattr)
+
+libc_hidden_def (__tcsetattr)
+weak_alias (__tcsetattr, tcsetattr)
diff --git a/sysdeps/unix/sysv/linux/tcsetattr.c b/sysdeps/unix/sysv/linux/tcsetattr.c
index 5a13ad8..49d9d24 100644
--- a/sysdeps/unix/sysv/linux/tcsetattr.c
+++ b/sysdeps/unix/sysv/linux/tcsetattr.c
@@ -77,5 +77,5 @@ __tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
return INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
}
+libc_hidden_def (__tcsetattr)
weak_alias (__tcsetattr, tcsetattr)
-libc_hidden_def (tcsetattr)
diff --git a/termios/tcsetattr.c b/termios/tcsetattr.c
index 30bc6d6..f0756be 100644
--- a/termios/tcsetattr.c
+++ b/termios/tcsetattr.c
@@ -23,7 +23,7 @@ static int bad_speed (speed_t speed);
/* Set the state of FD to *TERMIOS_P. */
int
-tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
+__tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
{
if (fd < 0)
{
@@ -57,7 +57,8 @@ tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
__set_errno (ENOSYS);
return -1;
}
-libc_hidden_def (tcsetattr)
+libc_hidden_def (__tcsetattr)
+weak_alias (__tcsetattr, tcsetattr)
/* Strychnine checking. */
static int