simplify ctermid
authorRich Felker <dalias@aerifal.cx>
Mon, 12 Jan 2015 05:59:49 +0000 (00:59 -0500)
committerRich Felker <dalias@aerifal.cx>
Mon, 12 Jan 2015 05:59:49 +0000 (00:59 -0500)
commit9772eadba8f8b32a1744c4df5048d70c567f6082
treea84dc010cc286e3c63884c1666679bb5885e74d2
parent699d4532f6a8f792271c7f46608e2505ca3afc21
simplify ctermid

opening /dev/tty then using ttyname_r on it does not produce a
canonical terminal name; it simply yields "/dev/tty".

it would be possible to make ctermid determine the actual controlling
terminal device via field 7 of /proc/self/stat, but doing so would
introduce a buffer overflow into applications built with L_ctermid==9,
which glibc defines, adversely affecting the quality of ABI compat.
src/unistd/ctermid.c