about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/ttyname_r.c
diff options
context:
space:
mode:
authorÉrico Nogueira <ericonr@disroot.org>2021-05-03 22:51:52 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-05-07 13:56:02 -0300
commit05ae46ee7a70b158d58b2c8581451fed9c18da2a (patch)
tree31682c37355eb9be6ae35bc16b1738afe7800deb /sysdeps/unix/sysv/linux/ttyname_r.c
parent0fb3dadca2548df348904d083b4d911fa25503f5 (diff)
downloadglibc-05ae46ee7a70b158d58b2c8581451fed9c18da2a.tar.gz
glibc-05ae46ee7a70b158d58b2c8581451fed9c18da2a.tar.xz
glibc-05ae46ee7a70b158d58b2c8581451fed9c18da2a.zip
linux: implement ttyname as a wrapper around ttyname_r.
Big win in binary size and avoids duplicating the logic in multiple
places.

On x86_64, dropped from 1883206 to 1881790, a 1416 byte decrease.

Also changed logic to track if ttyname_buf has been allocated by
checking if it's NULL instead of tracking buflen as an additional
variable.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/ttyname_r.c')
-rw-r--r--sysdeps/unix/sysv/linux/ttyname_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c
index fa1578fb64..899a851a83 100644
--- a/sysdeps/unix/sysv/linux/ttyname_r.c
+++ b/sysdeps/unix/sysv/linux/ttyname_r.c
@@ -194,5 +194,5 @@ __ttyname_r (int fd, char *buf, size_t buflen)
 
   return ret;
 }
-
+libc_hidden_def (__ttyname_r)
 weak_alias (__ttyname_r, ttyname_r)