Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sigstack(2) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

setjmp, longjmp, _setjmp, _longjmp

sigaction, sigvec, signal



SIGSTACK(2,L)               AIX Technical Reference               SIGSTACK(2,L)



-------------------------------------------------------------------------------
sigstack



PURPOSE

Sets and gets signal stack context.

SYNTAX

#include <signal.h>

int sigstack (instack, outstack)
struct sigstack *instack, *outstack;

DESCRIPTION

The sigstack system call defines an alternate stack on which signals are to be
processed.

If the value of the instack parameter is nonzero, it points to a sigstack
structure, which has the following members:

      char     *ss_sp;
      int      ss_onstack;

The value of instack"->"ss_sp specifies the stack pointer of the new signal
stack.  Since stacks grow from numerically greater addresses to lower ones, the
stack pointer passed to the sigstack system call should point to the
numerically high end of the stack area to be used.  instack"->"ss_onstack
should be set to 1 if the process is currently executing on that stack;
otherwise, it should be 0.

If the value of the outstack parameter is nonzero, it points to a sigstack
structure into which the sigstack system call stores the current signal stack
state.

If the value of the instack parameter is NULL, the signal stack state is not
set.  If the value of the outstack parameter is NULL, the previous signal stack
state is not reported.

When a signal whose handler is to run on the signal stack occurs, the system
checks to see if the process is already executing on that stack.  If so, it
continues to do so even after the handler returns.  If not, the signal handler
runs on the signal stack, and the original stack is restored when the handler
returns.

Use the sigaction system call to specify whether a given signal's handler
routine should run on the signal stack.





Processed November 7, 1990       SIGSTACK(2,L)                                1





SIGSTACK(2,L)               AIX Technical Reference               SIGSTACK(2,L)



Warning:  A signal stack does not automatically increase in size as a normal
stack does.  If the stack overflows, unpredictable results may occur.

RETURN VALUE

Upon successful completion, a value of 0 is returned.  If the sigstack system
call fails, a value of -1 is returned and errno is set to indicate the error.

ERROR CONDITIONS

The sigstack system call fails and the signal stack context remains unchanged
if the following is true:

EFAULT    The instack or outstack parameter points to a location outside of the
          process's allocated address space.

RELATED INFORMATION

In this book:  "setjmp, longjmp, _setjmp, _longjmp," and "sigaction, sigvec,
signal."



































Processed November 7, 1990       SIGSTACK(2,L)                                2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026