serial port - read chars twice
I'm new to linux programming and have a few questions regarding serial ports.
My goal is to monitor a ttyS.
I work on an embedded system which has a ppp connection via modem. During an established ppp connection I need to check the traffic between ppp process and modem. (The modem is allowed to send state information and ppp frames at same time)
Is it possible to read from file descriptor without removing the characters from input stream? I don't want to change anything in ppp implematation. I already checked a lot of techniques to handle serial ports but the key issue is always the same. When I read from the stream I steal the input and destroy the ppp frames.
many thanks in advance