sigstack(2) System Calls Manual sigstack(2)Name
sigstack - set or get signal stack context
Syntax
#include <signal.h>
struct sigstack {
caddr_t ss_sp;
int ss_onstack;
};
sigstack(ss, oss)
struct sigstack *ss, *oss;
Description
The system call allows users to define an alternate stack on which signals are to be processed. If ss is nonzero, it specifies a signal
stack on which to deliver signals and tells the system if the process is currently executing on that stack. When a signal's action indi-
cates its handler should execute on the signal stack (specified with a call), the system checks to see if the process is currently execut-
ing 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. If oss is nonzero, the current signal stack state is returned.
Signal stacks are not grown'automatically, as is done for the normal stack. If the stack overflows, unpredictable results may occur.
Return Values
Upon successful completion, a value of zero (0) is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
Diagnostics
The system call fails and the signal stack context remains unchanged, if one of the following occurs.
[EFAULT] Either ss or oss points to memory that is not a valid part of the process address space.
See Alsosigvec(2), setjmp(3)sigstack(2)
Check Out this Related Man Page
SIGSTACK(2) System Calls Manual SIGSTACK(2)NAME
sigstack - set and/or get signal stack context
SYNOPSIS
#include <signal.h>
struct sigstack {
caddr_t ss_sp;
int ss_onstack;
};
sigstack(ss, oss);
struct sigstack *ss, *oss;
DESCRIPTION
Sigstack allows users to define an alternate stack on which signals are to be processed. If ss is non-zero, it specifies a signal stack on
which to deliver signals and tells the system if the process is currently executing on that stack. When a signal's action indicates its
handler should execute on the signal stack (specified with a sigvec(2) call), the system checks to see if the process is currently execut-
ing 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. If oss is non-zero, the current signal stack state is returned.
NOTES
Signal stacks are not ``grown'' automatically, as is done for the normal stack. If the stack overflows unpredictable results may occur.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Sigstack will fail and the signal stack context will remain unchanged if one of the following occurs.
[EFAULT] Either ss or oss points to memory that is not a valid part of the process address space.
SEE ALSO sigvec(2), setjmp(3)4.2 Berkeley Distribution June 30, 1985 SIGSTACK(2)
Hi Everybody,
Can anybody give me an pratical example where we can use SA_ONSTACK flag in sigaction() system call ?
Please explain me the significance of having an alternate signal stack in UNIX for signal handling.
Regards
Dinesh-Ahuja (2 Replies)
Hi,
when I execute a script on unix AIX, I've got an error message:
"Execution: 85328 Signal d'alarme".
If I edit this file with "vi", I ve got the same error after a while (about 1 minute).
If I try with another user I still have the problem.
But if I rename this file, no problem.
My... (5 Replies)
Hi, I am writing a C program under SCO Unix. I have a memory stack problem but do not know how to go about fixing it. I have tried running INSURE but that does not detect any problems.
Essentially the problem is that the memory address shifts on return from a routine. I pass a pointer to... (3 Replies)
Hi,
Recently I was reading some c coding by some colleagues and I noticed that the above trend. They will create a pipe for the process then they will use the standard signal handler to capture a particular signal and write that signal to the pipe. On the other end, the process will read the... (7 Replies)
Hi folks
I'm trying to write a signal handler (in c on HPUX) that will catch the child process launched by execl when it's finished so that I can check a compliance file.
The signal handler appears to catch the child process terminating however when the signal handler completes the parent... (3 Replies)
Hi all,
Just a little question relative to signals.
I know that if an application is in the sleep state, When a signal is catched, it will be processed by the handler. But what happens if it's processing something? Does the processing stops??
The following code should illustrate this case
... (2 Replies)
Hi all,
How can a process be aware of the signals it handles. I looked at available signal API, but couldn't find any help.
If a process defines it own handler for a signal, the default handler for that signal becomes overridden.
I am interested in getting to know the... (2 Replies)
Is it possible to send a custom signal to a process?
e.g. Send signal 9999 to my process, which handles it with some custom handler.
How would one do this? (12 Replies)
I'm trying to create a simplified version of dc to learn from. The first thing I notice is that the main stack stores strings. How would I implement a string stack in C? How is something like this:
struct StringStack
{
const unsigned int pysicalSize; // physical size of the stack... (3 Replies)
Our stack used to be FreeBSD - Lighttpd - MySQL - Perl - Python - C++, which abbreviates to flimppc++ and pronounced as flimpsy.
Not great, but still better than our newer stack: Linux - Lighttpd - MariaDB - Perl - Python - C++, which abbreviates to llimppc++. The phonetic meaning behind that... (2 Replies)
Hello and thanks in advance for any help anyone can offer me
I've been reading up on process signal calls (sighup, sigint, sigkill & sigterm) and I understand they all have different methods of terminating a running process. From what I've also read is a exit() actually terminates a process. ... (2 Replies)
I am trying to illustrate the reverse order of parameters on the stack when passed to a function in C:
#include <stdio.h>
void p(int p1, int p2, double p3)
{
printf("params:\n"
"1) %p offset = %li\n"
"2) %p offset = %li\n"
... (5 Replies)