Sample Header Ad - 728x90

documentation on ptmx and pts

3 votes
1 answer
2951 views
I am want to stream a linux terminal to my own program, and as far as I understand this is done by opening /dev/ptmx to start a new pts, I have tested this and this does indeed work (it creates a new file in /dev/pts). But I am not sure how I am supposed to actually read and write to this terminal. Writing directly to /dev/pts/(pts number) I just get an input/output error. Also, am I supposed to open /dev/ptmx and /dev/pts/(pts number) at the same time with the same program. Am I supposed to somehow open a shell first? I find this stuff kinda confusing and I have not been able to find much information except for this man page http://man7.org/linux/man-pages/man4/pts.4.html
Asked by TT-392 (247 rep)
Sep 22, 2018, 02:03 PM
Last activity: Nov 1, 2023, 04:29 PM