Sponsored Content
Top Forums Programming catching all signals in a single handler Post 59085 by jim mcnamara on Thursday 9th of December 2004 10:10:54 AM
Old 12-09-2004
FWIW - SIGBUS is not precsiely what you described - you basically described SIGSEGV.

What Perderabo is telling you, politely, is that you have code errors.
 

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
sigvec(2)							System Calls Manual							 sigvec(2)

NAME
sigvec - Provides a compatibility interface to the sigaction() function SYNOPSIS
#include <sys/signal.h> int sigvec ( int signal, struct sigvec *in_vec, struct sigvec *out_vec ); PARAMETERS
Specifies the signal number. Points to a sigvec() structure that specifies the action to be taken when the specified signal is delivered, the mask to be used when calling the signal handler, and the flags that modify signal behavior. Points to a sigvec() structure that is set to the previous signal action state on successful return from the sigvec() function. DESCRIPTION
The sigvec() function is provided for compatibility to old UNIX systems; its function is a subset of that available with the sigaction() function. Like the sigaction() function, the sigvec() function allows the user to set the action to take upon the receipt of a signal and to specify a signal handler mask to block signals before calling the signal handler. However, only signals with values 1 to 31 can be masked on entry to a signal-handler set up with the sigvec() function. The sigvec() structure has the following members: void (*sv_handler)( ); int sv_mask; int sv_flags; The sv_handler field specifies the action for the signal, and can be SIG_DFL, SIG_IGN, or the address of a signal handler function. See the sigaction() function for a detailed description of the signal actions. The sv_mask field specifies a mask which specifies signals to block (in addition to any signals already blocked at time of delivery) when the signal handler function is called for the signal. Signal i is blocked if the i-th bit of the mask is set. Only signals with values 1 to 31 can be masked with the sigvec() function. The sv_flags field contains flags that further specify signal behavior. If SV_ONSTACK is set, the signal handler runs on the signal stack specified by the sigstack() function; otherwise, the signal handler runs on the stack of the process receiving the signal. If SV_INTERRUPT is set, a system call that is interrupted by signal returns a value of -1 with errno set to [EINTR]; otherwise, a system call interrupted by signal is restarted. If the value of the in_vec parameter is a null pointer, then the signal handler information is not set. If the value of the out_vec parame- ter is null, then the previous signal handler information is not returned. Once a signal handler is assigned, it remains assigned until another call to the sigvec(), signal(), sigaction(), or exec function is made. NOTES
The sigvec() function is provided for compatibility only, and its use is not recommended. Programs should use the sigaction() function instead. The sigvec() function does not check the validity of the sv_handler field pointer. If it points to a location outside of the process address space, the process receives a memory fault when the system attempts to call the signal handler. If the sv_handler field points to anything other than a function, the results are unpredictable. The signal-handler function can be declared as follows: void handler ( int signal ); RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. If the sigvec() function fails, a value of -1 is returned and errno is set to indicate the error. ERRORS
If the sigvec() function fails, no new signal handler is installed and errno may be set to one of the following values: The in_vec or out_vec parameter points to a location outside of the process' address space. The signal parameter is not a valid signal number. An attempt was made to ignore or supply a handler for the SIGKILL signal. RELATED INFORMATION
Functions: kill(2), ptrace(2), sigaction(2), sigblock(2), sigpause(3), sigstack(2) delim off sigvec(2)
All times are GMT -4. The time now is 05:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy