Yes you are right, I have added another test because the out err could have different terminals returned by ttyname_r as we pass the fd to ttyname_r, right?