How to moniter SIGHUP in QNX 4.xx
Title: How to moniter SIGHUP in QNX 4.xx
Keywords: How to moniter SIGHUP in QNX 4.xx
Date: Mar 19 1997
KDB Number: kdb-172
Distribution: External.
Please refer to the signal() function description in the QNX Watcom C Library Reference Manual.
This function, signal(), would be used in detecting when a SIGHUP occurs (carrier detect goes low due to a disconnection).
signal(SIGHUP, CleanUpAfterSighup);
When this occurs your custom handler (CleanUpAfterSighup) would do the housekeeping operations of closing any files that are open, and or go on, to monitor another incoming call.
Pseudo-code snippet
#include
sig_atomic_t signal_count;
void CleanUpAfterSighup(int sig_number)
{
++signal_count;
}
void main()
{
signal(SIGHUP, CleanUpAfterSighup); /*set own handler to perform a clean up*/
/* ...the rest of your application... */
}
Generally examples can be found at the following resources:
- quics, QSSL has lots of free source in the /usr/free area.
- You can also post a question on quics, or post to comp.os.qnx newsgroups.
-- end kdb.172 --