Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!cs.wvu.wvnet.edu!schiebel From: schiebel@cs.wvu.wvnet.edu (Darrell Schiebel) Newsgroups: comp.unix.aux Subject: AUX, signal, and sigvec Keywords: signal sigvec Message-ID: <1497@h.cs.wvu.wvnet.edu> Date: 3 May 91 13:04:34 GMT Organization: WVU Statistics and Computer Science Lines: 62 I am tring to get signal trapping working on some code I'm porting to AUX. Here is the code I'm using (the entire code is at the end of message): svec.sv_flags = 0; svec.sv_mask = 0xffffff; svec.sv_handler = catcher; if (sigvec(2,&svec,0) == -1){ Where "catcher" is the signal handler. I`ve tried other things for the "sv_mask",0 and 2. Does the mask indicate signals which get passed to handlers or signals which do not get passed? At any rate, the above code works when compiled on Suns but not when compiled on A/UX. I get the error invalid argument when I make the call to sigvec. Any suggestions? The "signal" works both on Sun and A/UX (attesting to its portablility). So why not use signal? In the A/UX man pages it sayes that the only thing passed to the signal handler is the signal id. I need to have more information than this, i.e. the information provided by "sigvec": ghandle (sig, code, scp) int sig, code; struct sigcontext *scp; I'd appreciate any information anyone could provide. Also on the Sun, using signal instead of sigvec, the handler gets called with each signal sent with "kill", but under A/UX the process dies with the second signal. Do I need to reset something. Suns are very forgiving. Many Thanks, Darrell Schiebel (schiebel@a.cs.wvu.wvnet.edu) (drs@baks.bell-atl.com) --X--X--X--X--X--X--X--X--X--X--X--X--X--X--X--X--X-- #include #include #include int catcher(){ printf("in catcher\n");} main(){ struct sigvec svec; svec.sv_flags = 0; svec.sv_mask = 0xffffff; svec.sv_handler = catcher; /* signal(2,catcher);*/ if (sigvec(2,&svec,0) == -1){ perror("main"); switch(errno){ case EFAULT: printf("EFAULT\n"); break; case EINVAL: printf("EINVAL\n"); break;} exit(1);} while (! feof(stdin));}