Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.system > #392
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Rainer Weikusat <rweikusat@mssgmbh.com> |
| Newsgroups | comp.os.linux.development.system |
| Subject | Re: Linux c alarm signal cannot receive |
| Date | Tue, 07 Feb 2012 16:56:00 +0000 |
| Lines | 25 |
| Message-ID | <87ehu6a8gv.fsf@sapphire.mobileactivedefense.com> (permalink) |
| References | <ead58a70-4307-4056-bf69-1a7d67c35eea@qv4g2000pbc.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| X-Trace | individual.net yBsZPYteRgQk7Ujs+GJJDQau4prazYeYSCe0qy3j0FXgJd6w8= |
| Cancel-Lock | sha1:Mx8nqJq2rA1BvVt9junPU9g0k6Q= sha1:XdJIVT2OHKMZ6POu1m61b3MtdgM= |
| User-Agent | Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
| Xref | x330-a1.tempe.blueboxinc.net comp.os.linux.development.system:392 |
Show key headers only | View raw
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