Sample Header Ad - 728x90

How can we find out the pseudoterminal master and slave from each other?

3 votes
3 answers
3887 views
A pseudoterminal has a pair of master and slave. How can we find out the master device file from a slave device file (e.g. /etc/pts/3)? I only find /dev/ptmx and /dev/pts/ptmx, but they can't be shared by multiple slaves. Given one of the processes working on the master and slave, how can we find out the other? For example, ps provides information about the controlling tty of each process. Can it be helpful? Thanks.
Asked by Tim (106420 rep)
Jan 3, 2019, 06:14 PM
Last activity: Dec 9, 2020, 12:51 PM