signal-handling Questions

2

How can I register a signal handler for ALL signal, available on the running OS, using signal(3)? My code looks like this: void sig_handler(int signum) { printf("Received signal %d\n", signum); ...
Speak asked 22/6, 2013 at 22:7

1

Solved

I am trying to learn signal handling among processes and threads. The answer to a few questions would help me understand it better. I know that a process can send a signal to the process group an...
Unmerciful asked 5/10, 2014 at 0:19

2

Solved

I've got a program with a specialized Process-type class which handles executing the processes natively on Linux. It does not use Java's Process class at all, because it needs to do some special ...
Dedicated asked 20/9, 2013 at 16:34

1

I am using pika.BlockingConnection in a consumer which performs some tasks for each message. I have also added signal handling so that the consumer dies properly after completely performing all tas...
Bloodstone asked 30/4, 2014 at 12:13

1

Solved

I'm working on a project in C involving linked lists, and I need to segfault a piece of code in order to prove it doesn't work. But my code can't crash. Here's my handler so far: typedef vo...
Demantoid asked 26/2, 2014 at 20:18

5

Solved

On Linux/Unix there are signals. The CtrlC one (SIGINT) is obvious to me. Now, in some other applications there are signals via CtrlX?! Is that even a signal or does it generate an escape sequence...
Foley asked 20/7, 2011 at 15:17

4

Solved

I have been coming across errors in compilation of my signal handler program written in C language with gcc in displaying the dumped register values after occurance of Segmentation fault. When i tr...
Orphrey asked 15/4, 2011 at 15:49

1

Solved

I installed python-daemon and now I'm trying to get the signal handling right. My code: #!/usr/bin/env python # -*- coding: utf-8 -*- import signal, time, syslog import daemon def runDaemon(): ...
Unpolled asked 18/1, 2014 at 18:53

1

Solved

Background I'm writing a framework to enable co-simulation of RTL running in a simulator and un-modified host software. The host software is written to control actual hardware and typically works ...
Atlantes asked 11/1, 2014 at 22:30

2

Solved

Here's the problem: this program should receive input from stdin and count the bytes inserted; the SIGUSR1 signal whill stop the main program and will print on file standard error how many bytes ha...
Diaphanous asked 19/3, 2013 at 13:28

4

I am in a situation where I need to read a binary search tree (BST) inside a signal handler (SIGSEGV signal handler, which according to my knowledge is per thread base). The BST can be modified by ...
Campanology asked 13/12, 2011 at 16:0

3

Solved

In my multithreaded GUI application I have the following signal handling code. I want to improve this code so that it will be correct and threading safe but there are some things I don't fully unde...
Kristofor asked 18/10, 2012 at 10:13

1

Solved

Recently I was working on a software written in c which had about a 3-4 thousand lines of code.When I started to get segmentation faults ,I added a SIGSEGV handler.This helped me in pin pointing th...
Lemmie asked 23/7, 2012 at 18:15

1

Solved

To start off, I'm having trouble getting my serial device to generate a SIGIO when data is ready to be read. I am trying to write a simple serial interface to communicate to a micro using a usb to...
Slapup asked 13/4, 2012 at 2:4

1

Solved

I've made the follow signal handler struct sigaction pipeIn; pipeIn.sa_handler = updateServer; sigemptyset(&pipeIn.sa_mask); sa.sa_flags = SA_RESTART; if(sigaction(SIGUSR1, &pipeIn, NULL)...
Datha asked 15/2, 2012 at 22:25

4

Solved

I am writing an API that uses sockets. In the API, I allocate memory for various items. I want to make sure I close the sockets and free the memory in case there is a signal such as Ctrl-C. In rese...
Horick asked 26/1, 2012 at 17:30

1

Solved

I'm writing a shell program that must handle signals. My relevant signal handling related code is as follows: #include <signal.h> ... #include <sys/types.h> ... void installSigac...
Shoulders asked 13/1, 2012 at 4:45

2

It is said that you should only call asynchronous-safe functions inside a signal handler. My question is, what constitutes asynchronous-safeness? A function which is both reentrant and thread safe ...
Glavin asked 13/12, 2011 at 17:0

2

Solved

Am I not leaving my signal handler function in the correct way? It does not seem to return to the program normally. Instead it goes into the loop and where it should wait for user input, it skips a...
Finnic asked 29/11, 2011 at 0:15

2

Solved

I'm currently writing a small shell in C++. Jobs and the PIDs associated with them are stored within a queue of job pointers (job *). When a new job is run, information about it is added to the qu...
Bael asked 16/11, 2011 at 2:55

1

Solved

I read that kill is unsafe respect to signals here. What else should I use if I want to kill child process as part of clean up inside my signal handler? What are my alternatives?
Unwell asked 7/8, 2011 at 6:39

3

Solved

using select() with pipe - this is what I am doing and now I need to catch SIGTERM on that. how can I do it? Do I have to do it when select() returns error ( < 0 ) ?
Rutheruthenia asked 5/8, 2011 at 20:19

3

Solved

I am reading The Design and Evolution of C++, by Bjarne Stroustrup. Regarding exeception handling and asynchronous signals it is mentioned as below: Can exceptions be used to handle things like si...
Leeuwenhoek asked 30/6, 2011 at 13:10

3

Solved

I have a process p registered with a signal handler for SIGALRM. A timer is setup to periodically send signal SIGALRM to process p. There are also multiple threads running in process p. Is the sign...
Oxfordshire asked 25/5, 2011 at 17:40

1

Solved

I've looked through the documentation, etc, but I'm not seeing anything obvious. I'd like to have a signal handler that can intercept ^C, ^\, or some other keypress that could be used to interrupt ...
Selfless asked 6/5, 2011 at 5:1

© 2022 - 2024 — McMap. All rights reserved.