01-16-2015
You can't safely use malloc() or pthread_mutex_lock() in a signal handler. You can only use async-signal safe calls in a signal handler. A list of Linux async-signal safe calls can be found here:
signal(7) - Linux manual page
This User Gave Thanks to achenle For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
AIX 4.3.3
I am trying to write a signal handler into a ksh shell script. I would like to capture the SIGTERM, SIGINT, and the SIGTSTP signals, print out a message to the terminal, and continue executing the script. I have found a way to block the signals:
#! /bin/ksh
SIGTERM=15
SIGINT=2... (2 Replies)
Discussion started by: jalburger
2 Replies
2. Solaris
hi
i am using solaris 9 on sparc .
i was wondering if there was a command to control my serial interface , as to send a signal periodically every interval of time to the input of a 555 timer .
thanks for your help .... (0 Replies)
Discussion started by: ppass
0 Replies
3. Programming
Hi,
I have an c++ application which uses the function fork and execvp().
The parent does not wait until the child ends. The parents just creates children and let them do their stuff.
You can see the parent program as a batch-manager.
I have added a SIGCHLD handler to the program:
void... (3 Replies)
Discussion started by: jens
3 Replies
4. Programming
Hey guys,
I am trying to write a little shell, and was writing a signal handler to handle SIGINT (I am using 'stty intr ^C' and using ctrl-C to give SIGINT).
I wrote this signal handler: void handle_sigint()
{
write(2,"handling sigint\n",16);
write(1,"\nshell% ",8);
}
... (4 Replies)
Discussion started by: blowtorch
4 Replies
5. Programming
I have written a program to demonstrate a problem I have encountered when using BSD style asynchronous input using the O_ASYNC flag in conjunction with a real time interval timer sending regular SIGALRM signals to the program. The SIGIO handler obeys all safe practices, using only an atomic update... (8 Replies)
Discussion started by: stewartw
8 Replies
6. Shell Programming and Scripting
I have a problem with signal handlers not working.
I have a long 1000 line code and somehow this code for signal handling is not working:
$SIG{INT} = \&interrupt;
sub interrupt {
print STDERR "Caught a control c!\n";
exit; # or just about anything else you'd want to do
}
Any... (2 Replies)
Discussion started by: som.nitk
2 Replies
7. UNIX for Dummies Questions & Answers
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
Hi,
I have a problem with signal handler algorithm in linux. My code is hanging ( It is continuously looping inside the signal handler) . I am pasting my code here...
Please provide me some help regarding this. I googled many places and wrote this code.. but doesnt seem to be working without... (6 Replies)
Discussion started by: sree_ec
6 Replies
9. Shell Programming and Scripting
I was working on some Perl code that does signal handling and I came across this one liner and wasn't sure what it was doing.
local $SIG{__DIE__} = sub {$! = 2; die $_;};
I think the first part of the anonymous subroutine is setting $! to 2, but I am not sure what the second part is doing. ... (1 Reply)
Discussion started by: SFNYC
1 Replies
10. Programming
i m unble to execute code of
signal handler using
a) Wait b) Waitpid (1 Reply)
Discussion started by: madhura
1 Replies
LEARN ABOUT SUSE
netsnmp_serialize
serialize(3) net-snmp serialize(3)
NAME
serialize -
Calls sub handlers one request at a time.
Functions
netsnmp_mib_handler * netsnmp_get_serialize_handler (void)
returns a serialize handler that can be injected into a given handler chain.
int netsnmp_register_serialize (netsnmp_handler_registration *reginfo)
functionally the same as calling netsnmp_register_handler() but also injects a serialize handler at the same time for you.
int netsnmp_serialize_helper_handler (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
*reqinfo, netsnmp_request_info *requests)
Implements the serial handler.
void netsnmp_init_serialize (void)
initializes the serialize helper which then registers a serialize handler as a run-time injectable handler for configuration file use.
Detailed Description
Calls sub handlers one request at a time.
This functionally passes in one request at a time into lower handlers rather than a whole bunch of requests at once. This is useful for
handlers that don't want to iterate through the request lists themselves. Generally, this is probably less efficient so use with caution.
The serialize handler might be useable to dynamically fix handlers with broken looping code, however.
Function Documentation
netsnmp_mib_handler* netsnmp_get_serialize_handler (void)
returns a serialize handler that can be injected into a given handler chain.
Definition at line 25 of file serialize.c.
void netsnmp_init_serialize (void)
initializes the serialize helper which then registers a serialize handler as a run-time injectable handler for configuration file use.
Definition at line 87 of file serialize.c.
int netsnmp_register_serialize (netsnmp_handler_registration * reginfo)
functionally the same as calling netsnmp_register_handler() but also injects a serialize handler at the same time for you.
Definition at line 34 of file serialize.c.
int netsnmp_serialize_helper_handler (netsnmp_mib_handler * handler, netsnmp_handler_registration * reginfo, netsnmp_agent_request_info *
reqinfo, netsnmp_request_info * requests)
Implements the serial handler.
Definition at line 42 of file serialize.c.
Author
Generated automatically by Doxygen for net-snmp from the source code.
Version 5.5 23 Sep 2009 serialize(3)