Sponsored Content
Top Forums Programming catching all signals in a single handler Post 58965 by Perderabo on Monday 6th of December 2004 12:18:37 PM
Old 12-06-2004
When you a signal from pid 0, that is the kernel. It is sending a SIGBUS because your program has a bus error.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

catching interrupts

hey i have been facing a problem,can you tell me if we can catch ctrl d in unix i have tried and sucessfully catched and disabled ctrl-c and ctrl -z but am not sure if we can do the same for CTRL-D, so got any clue mail on he forum or ...i mean c programming in Unix thats what i am working on (1 Reply)
Discussion started by: toughguy2handle
1 Replies

2. Shell Programming and Scripting

catching some errors

I need to find a way to keep a running tally of how many times events or actions occur. Say if a user is prompted to make inputs of 1 or 2, I want it to keep track of how many times 1 was entered, and how many times 2 was entered. Thanks for your help (5 Replies)
Discussion started by: bebop1111116
5 Replies

3. UNIX for Dummies Questions & Answers

Catching print jobs.

Hi, I am wondering how to catch print jobs to process them before been served to the printer. I was told that the challenge is to catch raw text that an old legacy application sends to the printer (invoices, quotes, etc) and save them as text files to allow a new application to process them... (5 Replies)
Discussion started by: miguel77mex
5 Replies

4. Programming

Signal catching

Hi! I want to catch all signals that my program receives print their name and then execute the default handler. Can you help me on that? I've tried the following code: #include <stdio.h> #include <unistd.h> #include <signal.h> void (*hnd)(int i); char signals = { "SIGHUP",... (7 Replies)
Discussion started by: dark_knight
7 Replies

5. Shell Programming and Scripting

XML Handler in perl

Hi there, I'm newby in perl and XML. I can read and parse Xml with XML-Node upper XML::Parser, but how can I create XML tags and pack my individual data in it then send through socket. PLZ lead me :) Meanwhile what is your opinion about XML Writer library? Thanks in Advance. (2 Replies)
Discussion started by: Zaxon
2 Replies

6. Shell Programming and Scripting

Catching errors

Hi, I'm writing a scheduling script which will co-ordinate the launching of scripts. This script is scheduling based on an input file, and launches the appropriate scripts at the right times. The only issue I'm having is: - if a script dies, or even has a syntax error, I want to catch... (1 Reply)
Discussion started by: GoldenEye4ever
1 Replies

7. UNIX for Dummies Questions & Answers

Doubt with irq handler.......

Hello, I have develop a driver for my hardware and now, I need to handle a IRQ but I does not work. As I can understand, to handle a irq, it is necessary to make a request_irq(). If the return value is zero, ok, no problem to handle irq. Here is a easy example of my driver: #include... (8 Replies)
Discussion started by: webquinty
8 Replies

8. Programming

SIGCHLD interrupts its own handler

Hi. I have a program whose job it is to manage 15 child processes. Sometimes these children die (sometimes deliberately other times with a SEGV). This causes a SIGCHLD to be sent to my program which uses waitpid() in the signal handler to gather information and, in most cases, restart the child.... (3 Replies)
Discussion started by: jrichemont
3 Replies

9. Shell Programming and Scripting

Catching error in sftp

Hi All Experts, I have a script which logs to the server via sftp connection with below code :- user_name@sftp_server.com and the connection is going smooth. My requirement is to place file in sftp_server in some path. and if path doesn't exist or the file is not put successfully I... (3 Replies)
Discussion started by: punitsoneji
3 Replies
sigset(3C)																sigset(3C)

NAME
sigset(), sighold(), sigrelse(), sigignore() - signal management SYNOPSIS
DESCRIPTION
The system defines a set of signals that can be delivered to a process. The set of signals is defined in signal(5), along with the meaning and side effects of each signal. An alternate mechanism for handling these signals is defined here. The facilities described here should not be used in conjunction with the other facilities described under signal(2) and sigspace(2). allows the calling process to choose one of four ways to handle the receipt of a specific signal. sig specifies the signal and func speci- fies the action handler. sig can be any one of the signals described under signal(5) except or func is assigned one of four values: or a function address. The actions prescribed by and are described under signal(5). The action pre- scribed by and function address are described below: Hold signal. The signal sig is held upon receipt. Any pending signal of this signal type remains held. Only one signal of each type is held. Note: the signals and cannot be held. function address Catch signal. func must be a pointer to a function, the signal-catching handler, that is called when signal sig occurs. specifies that the process calls this function upon receipt of signal sig. Any pending signal of this type is released. This handler address is retained across calls to the other signal management functions listed here. Upon receipt of signal sig, the receiving process executes the signal-catching function pointed to by func as described under signal(5) with the follow- ing differences: Before calling the signal-catching handler, the defined action of sig is set to During a normal return from the signal- catching handler, the defined action is restored to func and any held signal of this type is released. If a non-local goto (longjmp(3C)) is taken, must be called to restore the defined action to func and release any held signal of this type. holds the signal sig. restores the defined action of sig to that specified previously by and are used to establish critical regions of code. is analogous to raising the priority level and deferring or holding a signal until the priority is lowered by sets the action for signal sig to (see signal(5)). RETURN VALUE
Upon successful completion, returns the previous value of the defined action for the specified signal sig. Otherwise, a value of is returned and is set to indicate the error. is defined in For the other functions, a 0 value indicates that the call succeeded. A -1 return value indicates an error occurred and is set to indicate the reason. ERRORS
fails and the defined action for sig is not changed if any of the following occur: The func argument points to memory that is not a valid part of the process address space. Reliable detection of this error is implementation dependent. and and fail and the defined action for sig is not changed if any of the following occur: sig is not a valid signal number. An attempt is made to ignore, hold, or supply a handler for a signal that cannot be ignored, held, or caught; see signal(5). WARNINGS
These signal facilities should not be used in conjunction with signal(2) and sigspace(2). SEE ALSO
kill(1), kill(2), pause(2), signal(2), sigspace(2), wait(2), abort(3C), setjmp(3C), sigpause(3C), signal(5). STANDARDS CONFORMANCE
sigset(3C)
All times are GMT -4. The time now is 06:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy