Groups | Search | Server Info | Login | Register
Groups > comp.os.linux.development.system > #392
| From | Rainer Weikusat <rweikusat@mssgmbh.com> |
|---|---|
| Newsgroups | comp.os.linux.development.system |
| Subject | Re: Linux c alarm signal cannot receive |
| Date | 2012-02-07 16:56 +0000 |
| Message-ID | <87ehu6a8gv.fsf@sapphire.mobileactivedefense.com> (permalink) |
| References | <ead58a70-4307-4056-bf69-1a7d67c35eea@qv4g2000pbc.googlegroups.com> |
knightmare <knightmare1980@gmail.com> writes:
> no "get signal" printed....why
> #include <stdio.h>
> #include <stdlib.h>
> #include <signal.h>
> #include <time.h>
> #include <strings.h>
> #include <unistd.h>
>
> void alarmhandler(int signum){
> printf("get signal %d\n",signum);
> }
> int main() {
> struct sigaction sa;
> bzero(&sa, sizeof sa);
> sa.sa_handler = alarmhandler;
> sigaction(SIGINT, &sa, 0);
> if(sigaction(SIGALRM, &sa, 0)==0){
> printf("success\n");
> }
> alarm(2);
> for(;;);
> }
Works for me.
Back to comp.os.linux.development.system | Previous | Next — Previous in thread | Next in thread | Find similar
Linux c alarm signal cannot receive knightmare <knightmare1980@gmail.com> - 2012-02-07 08:25 -0800
Re: Linux c alarm signal cannot receive Rainer Weikusat <rweikusat@mssgmbh.com> - 2012-02-07 16:56 +0000
Re: Linux c alarm signal cannot receive Josef Moellers <josef.moellers@ts.fujitsu.com> - 2012-02-09 13:54 +0100
Re: Linux c alarm signal cannot receive David Schwartz <davids@webmaster.com> - 2012-02-19 18:31 -0800
csiph-web