I would like only one process to open the PTY device created by socat.
I used the following to create my_ser
device, but it can be read / written by multiple processes.
socat -t 0 INTERFACE:my_nw,type=2 PTY,mode=0777,rawer,link=/dev/my_ser
I tried to used
socat -t 0 INTERFACE:my_nw,type=2 PTY,mode=0777,rawer,link=/dev/my_ser,ioctl-void=0x540c
to use the PTY exclusive lock (TIOCEXCL), but it does not work.
I can see the IOCTL being executed, but with no effect.
I am running on Ubuntu machine
I understood now the TIOCEXCL flag in more detail. The application opening the PTY terminal should use this flag to obtain the exclusive lock. If we use it during PTY creation in socat command, it has no effect. But it does not give any error as well.
Thus the application should call the ioctl flag and it should be removed from here.