I am working on Linux platform. I have a console based multi-threaded application which loads a multi-threaded shared object library for other functionalities. The shared object library internally opens a serial port for communication. The library uses 'open', 'read' and 'write' Linux system calls for serial communication. Serial communication uses signal-handler to receive data. The main thread in console application waits on 'scanf' statement, to get input from user.
Whenever there is any activity on serial port, signal are generated due to which the 'scanf' call is interrupted with EINTR (interrupted system call).
Is there any way by which 'scanf' would not be interrupted because on read-write operations on serial port ?