aboutsummaryrefslogtreecommitdiff
path: root/include
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 /include
parent0fb3dadca2548df348904d083b4d911fa25503f5 (diff)
downloadglibc-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 'include')
-rw-r--r--include/unistd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/unistd.h b/include/unistd.h
index 1363976..96c066c 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -134,8 +134,8 @@ libc_hidden_proto (__setresuid)
libc_hidden_proto (__setresgid)
extern __pid_t __vfork (void);
libc_hidden_proto (__vfork)
-extern int __ttyname_r (int __fd, char *__buf, size_t __buflen)
- attribute_hidden;
+extern int __ttyname_r (int __fd, char *__buf, size_t __buflen);
+libc_hidden_proto (__ttyname_r)
extern int __isatty (int __fd) attribute_hidden;
extern int __link (const char *__from, const char *__to);
extern int __symlink (const char *__from, const char *__to);