]> git.ipfire.org Git - thirdparty/glibc.git/commit
linux: implement ttyname as a wrapper around ttyname_r.
authorÉrico Nogueira <ericonr@disroot.org>
Tue, 4 May 2021 01:51:52 +0000 (22:51 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 7 May 2021 16:56:02 +0000 (13:56 -0300)
commit05ae46ee7a70b158d58b2c8581451fed9c18da2a
tree31682c37355eb9be6ae35bc16b1738afe7800deb
parent0fb3dadca2548df348904d083b4d911fa25503f5
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>
include/unistd.h
sysdeps/unix/sysv/linux/ttyname.c
sysdeps/unix/sysv/linux/ttyname_r.c