How can I detect when someone opens the slave side of a pty (pseudo-terminal) in Linux?
– I want a reader opening the slave side of the pty to receive data written strictly after the reader opens the pty (if my multi-writing process just writes data for a while before the reader opens the slave side, the data will buffer up and eventually the writer will block and the slave reader, upon opening, will immediately get all the buffered data — this is not desirable as I want it to get only data generated in the immediate temporal vicinity) – It must be a pty, not a named pipe, socket, etc, as isatty() and tcsetattr(), etc need to be OK so that existing binaries work