home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!TOROLAB6.VNET.IBM.COM!JENNIFER
- From: JENNIFER@TOROLAB6.VNET.IBM.COM ("Jennifer Hamilton")
- Newsgroups: comp.std.c
- Subject: ANSI description for signal handling
- Message-ID: <9208311827.AA10025@ucbvax.Berkeley.EDU>
- Date: 31 Aug 92 18:25:43 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Lines: 25
-
- ( ... also posted to comp.lang.c)
-
- In the ANSI standard under the description of the signal function,
- (section 4.7.1.1) it states the following:
-
- "The function func may terminate by executing a return statement or
- by calling the abort, exit, or longjmp functions. If func executes a
- return statement and the value of sig was SIGFPE or any other
- implementation-defined value corresponding to a computational
- exception, the behaviour is undefined. Otherwise, the program will
- resume execution at the point it was interrupted. If the signal
- occurs other than as the result of calling the abort or raise
- function, the behaviour is undefined if the signal handler calls any
- function in the standard library other than the signal function
- itself ..."
-
- The last sentence implies that you can't call any library functions
- (such as longjmp, abort or exit) from within the signal handler unless
- the signal was explicitly raised through raise or abort. But the first
- three sentences imply that you can. Can anyone explain this apparent
- contradiction?
-
- Jennifer Hamilton
- IBM Toronto Lab
- jennifer@torolab6.vnet.ibm.com
-