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:
Code:
void (*sa_handler)(int);
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 ULTRIX
sigaction
sigaction(3) Library Functions Manual sigaction(3)Name
sigaction - software signal facilities (POSIX)
Syntax
#include <signal.h>
struct sigaction {
void (*sa_handler)();
sigset_t sa_mask;
int sa_flags;
};
int sigaction(sig, vec, ovec)
int sig;
struct sigaction *vec, *ovec;
Description
The sigaction call is the POSIX equivalent to the system call. This call behaves as described on the reference page with the following mod-
ifications:
o The signal mask is manipulated using the functions.
o A process can suppress the generation of the SIGCHLD when a child stops by setting the SA_NOCLDSTOP bit in sa_flags.
o The SV_INTERRUPT flag is always set by the system when using in POSIX mode. The flag is set so that interrupted system calls will fail
with the EINTR error instead of getting restarted.
Return Values
A 0 return value indicated that the call succeeded. A -1 return value indicates an error occurred and errno is set to indicated the rea-
son.
Diagnostics
The system call fails and a new signal handler is not installed if one of the following occurs:
[EFAULT] Either vec or ovec points to memory which is not a valid part of the process address space.
[EINVAL] Sig is not a valid signal number.
[EINVAL] An attempt is made to ignore or supply a handler for SIGKILL or SIGSTOP.
See Alsosigvec(2), sigsetops(3), sigprocmask(3), sigsuspend(3), sigpending(2), setjmp(3), siginterrupt(3), tty(4)sigaction(3)