home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / std / c / 2542 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.5 KB

  1. 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
  2. From: JENNIFER@TOROLAB6.VNET.IBM.COM ("Jennifer Hamilton")
  3. Newsgroups: comp.std.c
  4. Subject: ANSI description for signal handling
  5. Message-ID: <9208311827.AA10025@ucbvax.Berkeley.EDU>
  6. Date: 31 Aug 92 18:25:43 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 25
  9.  
  10. ( ... also posted to comp.lang.c)
  11.  
  12. In the ANSI standard under the description of the signal function,
  13. (section 4.7.1.1) it states the following:
  14.  
  15.    "The function func may terminate by executing a return statement or
  16.    by calling the abort, exit, or longjmp functions.  If func executes a
  17.    return statement and the value of sig was SIGFPE or any other
  18.    implementation-defined value corresponding to a computational
  19.    exception, the behaviour is undefined.  Otherwise, the program will
  20.    resume execution at the point it was interrupted.  If the signal
  21.    occurs other than as the result of calling the abort or raise
  22.    function, the behaviour is undefined if the signal handler calls any
  23.    function in the standard library other than the signal function
  24.    itself ..."
  25.  
  26. The last sentence implies that you can't call any library functions
  27. (such as longjmp, abort or exit) from within the signal handler unless
  28. the signal was explicitly raised through raise or abort.  But the first
  29. three sentences imply that you can.  Can anyone explain this apparent
  30. contradiction?
  31.  
  32. Jennifer Hamilton
  33. IBM Toronto Lab
  34. jennifer@torolab6.vnet.ibm.com
  35.