A Unix system command needs to be executed from a C/C++ program. How do I use the SIGALRM in this case to stop processing the command after a few sec.
For eg, if the command is to connect to a database and the server is down, I would want to try for say 15 sec then give a timeout error.
How do I code this ?
I have written a program to demonstrate a problem I have encountered when using BSD style asynchronous input using the O_ASYNC flag in conjunction with a real time interval timer sending regular SIGALRM signals to the program. The SIGIO handler obeys all safe practices, using only an atomic update... (8 Replies)