Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!netnews.upenn.edu!grad1.cis.upenn.edu!arup From: arup@grad1.cis.upenn.edu (Arup Mukherjee) Newsgroups: comp.unix.questions Subject: problems with SIGALRM..... Message-ID: <9709@netnews.upenn.edu> Date: 8 Apr 89 22:58:35 GMT Sender: news@netnews.upenn.edu Reply-To: arup@grad1.cis.upenn.edu.UUCP (Arup Mukherjee) Distribution: na Organization: University of Pennsylvania Lines: 47 Dear netlanders, Can anyone tell me what is wrong with the following program? It works fine under Ultrix 3.0 but not under earlier versions of Ultrix. It also does not work under SunOS 4.0. Am I making some kind of mistake, or is this a known bug? If so, are there any workarounds that will allow SIGALRM to work properly. (Note that if I try to trap, for example, SIGSEGV instead, and then generate a segmentation violation on purpose, it works on any machine). Thanks very much.... Arup Mukherjee [arup@grasp.cis.upenn.edu] ---cut here--- # include # include struct sigvec f; int handler() { fprintf (stderr, "I got a signal!\n"); fflush(stderr); } main() { # ifdef TRY2 /* neither of these two work on */ f.sv_handler = handler; /* most machines I tried */ f.sv_mask = 0; f.sv_onstack = 0; /* Under Ultrix 3.0 on a */ /* uVax 3500, both work ok */ sigvec (SIGALRM, &f, NULL); # else signal (SIGALRM, handler); # endif alarm(1); sleep(10); }