Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Apropos / Subsearch:
optional field

sigstack(2)							  sigstack(2)

  sigstack - Sets and gets signal stack	context


  #include <&lt;signal.h>&gt;

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


  Interfaces documented	on this	reference page conform to industry standards
  as follows:

  sigstack():  XPG4-UNIX

  Refer	to the standards(5) reference page for more information	about indus-
  try standards	and associated tags.


  instack   Points to the structure describing the new signal stack.

  outstack  Points to the structure where the current signal stack state is


  The sigstack() function 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:
       struct sigstack{
	       caddr_t ss_sp;
	       int ss_onstack; }

  The value of instack->ss_sp specifies	the stack pointer of the new signal
  stack.  The value of instack->ss_onstack should be set to 1 if the process
  is currently running on that stack; otherwise, it should be 0	(zero).

  If the value of the instack parameter	is 0 (that is, a null pointer),	the
  signal stack state is	not set.

  If the value of the outstack parameter is nonzero, it	points to a sig-
  stack() structure into which the sigstack() function stores the current
  signal stack state.  If the value of the outstack parameter is 0 (zero),
  the previous signal stack state is not reported.

  When a signal	occurs and its handler is to run on the	signal stack, the
  system checks	to see if the process is already running on that stack.	 If
  so, the process continues to run on that stack even after the	handler
  returns.  If not, the	signal handler runs on the signal stack, and the ori-
  ginal	stack is restored when the handler returns.

  Use the sigaction() function to specify whether a given signal handler rou-
  tine is to run on the	signal stack.


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

  The sigstack() function is scheduled to be withdrawn from a future version
  of the X/Open	CAE Specification.  When writing or rewriting portable appli-
  cations, use the sigaltstack() function instead of sigstack().


  Upon successful completion, a	value of 0 (zero) is returned.	Otherwise, a
  value	of -1 is returned and errno is set to indicate the error.


  The sigstack() function sets errno to	the specified values for the follow-
  ing conditions:

  [EFAULT]  The	instack	or outstack parameter points outside of	the address
	    space of the process.


  Functions: setjmp(3),	sigaction(2), sigvec(2)

  Standards: standards(5)