Passing serial settings from pseudoterminal to physical port
I have a daemon that redirects data from physical serial port (/dev/ttySx) to different data consumer processes using pseudo-terminals (/dev/pts/X). In the daemon I can redirect the data from serial port to any of my pseudo-terminals with dup2() function. But is there a way to do something similar to serial port settings? I mean that if the data consumer changes the pseudo-terminal settings with ioctl or tcsetattr(), I would like get the same changes to the physical serial port.
Any advices are greatly appriciated, thanks in advance.