diff options
author | Érico Nogueira <ericonr@disroot.org> | 2021-05-03 22:51:52 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-05-07 13:56:02 -0300 |
commit | 05ae46ee7a70b158d58b2c8581451fed9c18da2a (patch) | |
tree | 31682c37355eb9be6ae35bc16b1738afe7800deb /sysdeps/unix/sysv/linux/ttyname_r.c | |
parent | 0fb3dadca2548df348904d083b4d911fa25503f5 (diff) | |
download | glibc-05ae46ee7a70b158d58b2c8581451fed9c18da2a.zip glibc-05ae46ee7a70b158d58b2c8581451fed9c18da2a.tar.gz glibc-05ae46ee7a70b158d58b2c8581451fed9c18da2a.tar.bz2 |
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.c | 2 |
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 fa1578f..899a851 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) |