signal handler stack. again


I wrote simple test:

void sighandler(int signo);

int main(int argc, char**){
int i, *x = &argc;
signal(SIGSEGV, sighandler);
for (i=0;;i++,x–){
printf ("%d %x\n", i, *x);

void sighandler(int signo){
fprintf(stderr,“SIGSEGV. stack:%p\n”, &signo);
// now - exit, but in another cases I couls want to restore

And i see, signal handler stack is in the middle of my stack!!!
It can break data in the stack !!!

Q1: which is algorithm of signal handler ESP computation ?

Q2: how can I set signal stack in QNX6 (such as sigaltstack(…) call in some