Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #220
Difficulty: Easy
When multiple routers are used in interconnected networks, the routers can exchange information about destination addresses using a routing protocol.
True or False?
Linux & Unix Commands - Search Man Pages

sigstack(3ucb) [sunos man page]

sigstack(3UCB)					     SunOS/BSD Compatibility Library Functions					    sigstack(3UCB)

NAME
sigstack - set and/or get signal stack context SYNOPSIS
/usr/ucb/cc [ flag ... ] file ... #include <signal.h> int sigstack( nss, oss); struct sigstack *nss, *oss; DESCRIPTION
The sigstack() function allows users to define an alternate stack, called the "signal stack", on which signals are to be processed. When a signal's action indicates its handler should execute on the signal stack (specified with a sigvec(3UCB) call), the system checks to see if the process is currently executing on that stack. If the process is not currently executing on the signal stack, the system arranges a switch to the signal stack for the duration of the signal handler's execution. A signal stack is specified by a sigstack() structure, which includes the following members: char *ss_sp; /* signal stack pointer */ int ss_onstack; /* current status */ The ss_sp member is the initial value to be assigned to the stack pointer when the system switches the process to the signal stack. Note that, on machines where the stack grows downwards in memory, this is not the address of the beginning of the signal stack area. The ss_onstack member is zero or non-zero depending on whether the process is currently executing on the signal stack or not. If nss is not a null pointer, sigstack() sets the signal stack state to the value in the sigstack() structure pointed to by nss. If nss is a null pointer, the signal stack state will be unchanged. If oss is not a null pointer, the current signal stack state is stored in the sigstack() structure pointed to by oss. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The sigstack() function will fail and the signal stack context will remain unchanged if one of the following occurs. EFAULT Either nss or oss points to memory that is not a valid part of the process address space. SEE ALSO
sigaltstack(2), sigvec(3UCB), signal(3C) WARNINGS
Signal stacks are not "grown" automatically, as is done for the normal stack. If the stack overflows unpredictable results may occur. NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system libraries or in multi-threaded applications is unsupported. SunOS 5.10 22 Jan 1997 sigstack(3UCB)

Check Out this Related Man Page

sigstack(2)							System Calls Manual						       sigstack(2)

NAME
sigstack - Sets and gets signal stack context SYNOPSIS
#include <signal.h> int sigstack ( struct sigstack *instack, struct sigstack *outstack ); STANDARDS
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 industry standards and associated tags. PARAMETERS
Points to the structure describing the new signal stack. Points to the structure where the current signal stack state is stored. DESCRIPTION
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 sigstack() structure into which the sigstack() function stores the cur- rent 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 original stack is restored when the handler returns. Use the sigaction() function to specify whether a given signal handler routine is to run on the signal stack. NOTES
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 por- table applications, use the sigaltstack() function instead of sigstack(). RETURN VALUES
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. ERRORS
The sigstack() function sets errno to the specified values for the following conditions: The instack or outstack parameter points outside of the address space of the process. RELATED INFORMATION
Functions: setjmp(3), sigaction(2), sigvec(2) Standards: standards(5) delim off sigstack(2)

Featured Tech Videos