Questions tagged [signal-handling]
In the C Standard Library, signal processing defines how a program handles various signals while it executes. A signal can report some exceptional behavior within the program (such as division by zero), or a signal can report some asynchronous event outside the program (such as someone striking an interactive attention key on a keyboard).
18 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
7
votes
2
answers
3k
views
Proper implementation of signal handler and multithreading (pthread)
I am trying to implement a "proper" signal handler that works correctly for multiple threads, and to be as C-standard-conforming and POSIX-conforming as possible. The below is my ...
4
votes
1
answer
294
views
A deamon for sending poem to clients based on KISS
My code is about sending random poem from /etc/poem.conf to client using TCP sockets.
In this implementation my daemon have restart mechanism using SIGHUP signal and DEBUG mechanism using defining ...
6
votes
1
answer
2k
views
Client server communications through unix signals in C
For school, I have to create a server-client communication through Unix signals and only with SIGUSR1 and SIGUSR2.
Client ...
3
votes
1
answer
115
views
System V signal API using the standard POSIX API
I wrote a program that implements a POSIX signal API. It implements the functions sigset(), sighold(), ...
3
votes
1
answer
121
views
An attempt to use the sigpending function
I wrote a program that uses the sigpending () function. The program returns blocked or pending signals.
My question is, what else could I improve or what problems ...
1
vote
1
answer
1k
views
Basic Client/Server model using Unix signals
I've created a basic client/server model using user defined signals (SIGUSR1 representing bit 1 and SIGUSR2 for bit 0).
At a ...
4
votes
2
answers
167
views
Posix signal implementation
My hobby is Unix-like operating systems.
Recently I began writing my own sel4-based Posix compliant OS. Here's the code for internal signal handling functions which presents a kind of backend to help ...
6
votes
1
answer
8k
views
C++ event loop and thread signaling
Use case
This is an event loop and signaling system I created for a piece of software which will have multiple asynchronous server/clients/event-emitters/ui, some of those components will have their ...
4
votes
1
answer
6k
views
Suspend and resume a thread using signals
The other day I ran into this question on stackoverflow.
Just for curiosity I wanted to implement suspending and resuming the thread, so I used signals and used ...
3
votes
1
answer
7k
views
Dynamically Change Logging Level of a Python Process
The intention of following code is to dynamically change the logging level of a running python process that has imported this module.
...
10
votes
2
answers
6k
views
Safely and elegantly handling UNIX signals in Qt applications
When you search the web on how to gracefully shut down your Qt application when receiving SIGTERM, you are invariably directed towards this informative, yet ...
4
votes
0
answers
1k
views
SIGCONT Handler for terminal application
I'm writing a C++ application for POSIX environment with terminal-based User Interface. I'd like to make my application's UI be consistent between Ctrl-Z and ...
3
votes
1
answer
63
views
Bash script that displays and kills selected processes
This is my first Bash script and I decided to use what I've learned so far to help manage stray processes while I develop in my *nix environs.
I've tested the script extensively and it seems to work ...
user avatar
user52380
2
votes
1
answer
246
views
Git post-receive hook writen as a POSIX shell script (utilising a named pipe)
This is my first piece of code to post here. I wrote this script as a
post-receive hook for a Git repository but I’m not so concerned with the Git
parts (I’d like to have the part marked with ...
9
votes
1
answer
3k
views
Freeing shared memory with a signal handler
I have a homework question that asks me to get 2 integers from the user, put them in shared memory, fork a child, have the child add them and put the result in shared memory, and then the child will ...