From: utzoo!decvax!harpo!eagle!mhuxt!mhuxa!mhb5c!mhb5b!mjs Newsgroups: net.bugs.4bsd,net.unix-wizards Title: misfeature in 4.1BSD ttyname() Article-I.D.: mhb5b.158 Posted: Tue Mar 1 10:21:24 1983 Received: Wed Mar 2 06:17:16 1983 In ttyname(), each entry in /dev is tested against the st_rdev of the tty in question, as well as the st_ino field. In installations which make use of chroot logins (ala System 3 or 5), file descriptors 0, 1, and 2 get connected to the devices in the real root, while any program running under the subroot has access to a different filesystem for /dev, thus preventing ttyname() (and anything that uses ttyname()) from returning a useful answer! The fix is simply to remove the comparison of st_ino fields in ttyname.c. Happy hacking!