From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: fernanbolando@mailc.net, 9fans@9fans.net From: Charles Forsyth Date: Fri, 4 Jul 2008 10:59:30 +0100 In-Reply-To: <1d5d51400807040117i242cae83y6d65e8972748ea47@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] signal.h in APE for newbies Topicbox-Message-UUID: dac7004a-ead3-11e9-9d60-3106f5b1d025 > When I trigger a division by zero the handler is not called, I just > get trap 19 message. if i do a floating-point division by zero, the SIGFPE signal handler is called, because ape's signal recognises the initial "sys: fp: ". (ie, it works for me.) it doesn't work for an integer division by zero, which produces a different message for the underlying notify: 8.out 205840: suicide: sys: trap: divide error pc=0x00001089 but that's fine too! Linux's signal(2) says, apparently referring to POSIX rules: .... Integer division by zero has undefined result. On some architectures it will generate a SIGFPE signal. (Also dividing the most negative integer by -1 may generate SIGFPE.) Ignoring this signal might lead to an endless loop. Linux might not be particularly good at documenting this particular area, so perhaps the standard(s) have useful hints or advice that APE could follow.