Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sigstack(2) [ultrix man page]

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 Also
       sigvec(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)
Man Page

15 More Discussions You Might Find Interesting

1. Programming

signal stack SA_ONSTACK

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)
Discussion started by: md7ahuja
2 Replies

2. UNIX for Dummies Questions & Answers

Alarm signal

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)
Discussion started by: cgsteph
5 Replies

3. Programming

memory stack problem

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)
Discussion started by: jkeagy
3 Replies

4. Programming

Catching signal and piping

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)
Discussion started by: joseph_ng
7 Replies

5. Programming

Signal Handling

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)
Discussion started by: themezzaman
3 Replies

6. Programming

finding stack location in C using program

Is there a way to find the address of stack memory writing a program? Please guide me (12 Replies)
Discussion started by: jacques83
12 Replies

7. Programming

signals related question

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)
Discussion started by: ninjanesto
2 Replies

8. Programming

what is stack winding and stack unwinding

helo can u tell me what do you mean by stack winding and stack unwinding Regards, Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies

9. UNIX for Advanced & Expert Users

Getting status of a signal in process?

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)
Discussion started by: bluehive
2 Replies

10. Programming

Defining Custom Signal

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)
Discussion started by: joha
12 Replies

11. Programming

Implementing a stack of strings in C

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)
Discussion started by: afulldevnull
3 Replies

12. What is on Your Mind?

From Flimpsy to Limpsy

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)
Discussion started by: figaro
2 Replies

13. UNIX for Beginners Questions & Answers

Exit() system call verses process signals

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)
Discussion started by: bodisha
2 Replies

14. Shell Programming and Scripting

Call stack /bin/sh

call stack shell (5 Replies)
Discussion started by: julia_sus
5 Replies

15. Programming

Parameters placement on stack in C

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)
Discussion started by: migurus
5 Replies