Re: Copyovering on SIG{SEGV,BUS,..}

From: George (greerga@CIRCLEMUD.ORG)
Date: 05/02/98


On Fri, 1 May 1998, James Turner wrote:

>#define STACK_RETURN(n) \
>  mprotect(stack_guard, 4096, PROT_READ|PROT_WRITE|PROT_EXEC);\
>  return (n)
[...]
>  /* stuff happens */
>  if (blah < 0)
>    STACK_RETURN(-1);
>  else
>    /* more stuff */

Just to nitpick, that won't work unless you add {} to the if...else or
do{}while(0) to the macro.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST