On Linux, I'm opening a fake TTT on the master side. While there is no customer on the slave side, what I'm writing about the fake TTV is echoing, which I am not expecting. Consider the following code:
int main (int argc, char * argv []) {int ptyfd; Int rc; / * Return code * / four rediff [3]; Ptyfd = open ("/ dev / ptmx", O_RDWR | O_NOCTTY); Die_on_error (ptyfd, "open ptmx"); / * Unlock and printed slaves name * / rc = unlock (ptfd); Die_on_error (RC, "Unlock"); Printf ("name of slave number:% s \ n", ptsname (ptyfd)); Write (ptfd, "c", 1); RC = Reading (PTFD, Rediff, 1); Die_on_error (RC, "read"); Printf ("read% c \ n", readbuf [0]); Return 0; }
When I run this program, I hope to read the call, but instead it is quick and return content for Cd. How can I change this behavior? When the slave does not open, I would like that the character written on the Guru's side either disappears or FIFO for later reading by the slave party.
Changing the master side does it correctly?
I thought the gurant party was not a tty but apparently this is so that you call You can do things like tcgettattr
and tcsetattr
, and press Echo.
Comments
Post a Comment