🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux.programowanie
Article #72581

Re: Przejmowanie sygnały dzielenia przez zero

#72581
From: Kamil Jońca
Date: Sun, 09 Dec 2012 21:43
38 lines
1593 bytes
"Borneq" <borneq@antyspam.hidden.pl> writes:

> #include <stdio.h>
> #include <stdlib.h>
> #include <signal.h>
>
> int handle (int signo)
> {
> printf ("z handle, signo=%d\n",signo);
> }
>
> int inv(int n)//float,int 1/0 SIGFPE = 8
> {
>    return 1/n;
> }
>
> int main()
> {
>    void (*SIGFPE_saved) ();
>
>    SIGFPE_saved = signal (SIGFPE, handle);
>    inv(abs(0));
>    printf ("po inv\n");
>    signal (SIGFPE, SIGFPE_saved);
>    return 0;
> }
>
> Co zrobić aby w kólko nie wywoływał handle() ? 

Jak to "w kółko"?
KJ


-- 
http://blogdebart.pl/2012/06/24/hiena/
I hate mankind, for I think myself one of the best of them, and I know
how bad I am.
		-- Samuel Johnson
Technical Details
Message-ID: <87lid6lx4o.fsf@alfa.kjonca>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!eu.feeder.erje.net!news.mixmin.net!weretis.net!feeder4.news.weretis.net!feed.cnntp.org!news.cnntp.org!read.cnntp.org!not-for-mail
References: <ka2v0b$92u$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!eu.feeder.erje.net!news.mixmin.net!weretis.net!feeder4.news.weretis.net!feed.cnntp.org!news.cnntp.org!read.cnntp.org!not-for-mail
From: Kamil Jońca <kjonca@poczta.onet.pl>
Newsgroups: pl.comp.os.linux.programowanie
Subject: Re: Przejmowanie sygnały dzielenia przez zero
Date: Sun, 09 Dec 2012 22:43:35 +0100
Message-ID: <87lid6lx4o.fsf@alfa.kjonca>
References: <ka2v0b$92u$1@node2.news.atman.pl>
Mime-Version: 1.0
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)
Cancel-Lock: sha1:guAn473EKFdS8DeJigxxzBBI53o=
Lines: 38
NNTP-Posting-Host: 127.0.0.1
X-Trace: 1355089682 karibu 2086 kjonca/127.0.0.1:59412
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit