Curses signal handling question

Lorien Y. Pratt lorien at dartvax.UUCP
Tue Apr 17 01:38:00 AEST 1984


I have a program that uses the curses package.  I am attempting
to implement a feature where, after a certain amount of user idle
time, the program disconnects itself.

The section of code that I've written to implement this feature
looks like the following:

  signal(SIGALRM,hangup); 	/* If the alarm sounds, log user off */
  alarm(NUMSEC);  		/* Call the alarm clock */
  wgetstr( window, line );	/* Get a line from the screen */
  signal(SIGALRM,SIG_IGN);  	/* If we returned from input routine, ignore 
				   alarm */

(`hangup()' is my own disconnect routine)

This does not work.  When not using curses, however, it works like a
dream.  So I strongly suspect that curses is ignoring SIGALRM calls.
I've been through the curses source, however, and can't find any code
that looks like an alarm-ignorer.  I'm running under 4.2BSD.  Help!


      --Lorien Y. Pratt
	Dartmouth College Library
	Hanover, NH  03755

	decvax!dartvax!lorien



More information about the Comp.unix.wizards mailing list