Hello,
i am using the sigaction function to handle the SIGCHLD signal.Is it possible to use a class member function as the handler function (the sa_handler member of the sigaction structure)?
The function's signature is:
so i don't think i can use a static member function to call the actual handler function.
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)
Guys,
I'm doing signal handling in Perl. I'm trying to catch ^C signal inside the script.
There two scripts : one shell script and one perl script.
The shell script calls the perl script.
For e.g. shell script a.sh and perl scipt sig.pl.
Shell script a.sh looks something like this :... (6 Replies)
Hello all,
I am starting to learn signal handling in Linux and have been trying out some simple codes to deal with SIGALRM. The code shown below sets a timer to count down. When the timer is finished a SIGALRM is produced. The handler for the signal just increments a variable called count. This... (7 Replies)
Hi,
I have a main loop which calls a sub loop, which finally returns to the main loop itself. The main loop runs when a flag is set. Now, I have a signal handler for SIGINT, which resets the flag and thus stops the main loop. Suppose I send SIGINT while the program is in subloop, I get an error... (1 Reply)
I am trying to write a small program where I can send signals and then ask for an action to be triggered if that signal is received. For example, here is an example where I am trying to write a programme that will say you pressed ctrl*c when someone presses ctrl+c. My questions are what you would... (1 Reply)
Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento)
typedef struct elemento
{
char name;
char value;
List<struct elemento> ltElementos;
... (7 Replies)
I have the following class and thought that when I call the set command to set a member, I always use value. Would that be fine?
class ModMisfit {
protected:
Real dtau;
Real mdacc;
Real mindist;
bool hw;
Source** src;
public:
void ... (7 Replies)
There is base class B, and two derived classes D1 and D2 derived from Base. Base class B, have two data members ( public or protected or private or if any). D1 should inherit both these data members, and D2 should be deriving only one member from Base class. Is this kind of design possible without... (1 Reply)
Hello All,
I am a learner in C++. I was testing my inheritance knowledge with following piece of code.
#include <iostream>
using namespace std;
class base
{
public :
void display()
{
cout << "In base display()" << endl;
}
void display(int k)
{... (2 Replies)
Discussion started by: anand.shah
2 Replies
LEARN ABOUT OSF1
sigvec
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)