🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Przejmowanie sygnały dzielenia przez zero

#72580
From: Borneq
Date: Sun, 09 Dec 2012 21:14
26 lines
1406 bytes
#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() ? 
Technical Details
Message-ID: <ka2v0b$92u$1@node2.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: "Borneq" <borneq@antyspam.hidden.pl>
Newsgroups: pl.comp.os.linux.programowanie
Subject: Przejmowanie sygnały dzielenia przez zero
Date: Sun, 9 Dec 2012 22:14:56 +0100
Organization: ATMAN - ATM S.A.
Lines: 27
Message-ID: <ka2v0b$92u$1@node2.news.atman.pl>
NNTP-Posting-Host: 81.219.49.166
Mime-Version: 1.0
X-Trace: node2.news.atman.pl 1355087692 9310 81.219.49.166 (9 Dec 2012 21:14:52 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Sun, 9 Dec 2012 21:14:52 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Antivirus: avast! (VPS 121209-1, 2012-12-09), Outbound message
X-Antivirus-Status: Clean
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit