If I tell Perl to explicitly ignore a signal, SIGINT has no effect:
$SIG{INT} = 'IGNORE';
my $count = 0;
say $count++ and sleep 1 while 1;
Then pressing Control-C, rather obviously, has no effect. If, on the other hand, I tell it to do nothing:
$SIG{INT} = sub { };
my $count = 0;
say $count++ and sleep 1 while 1;
Then pressing Cont...
What is the SIGKILL permissions policy?
I assume I can't kill something of the kernel, or of some other user, while running on non-root, but I haven't found any document about this.
...
I need to implement a handshake type protocol in to a small Linux program that uses named pipes to communicate with other processes. I've searched for a general implementation pattern for a handshake type protocol when using named pipes but I've not been able to turn anything up...
I simply can't believe that there isn't patterns to do ...
I want to designate a callback for UDP port such that every time a new packet arrives, a handler is called for it.
I know about using fcntl() to cause file descriptors to raise SIGIO, but let's say things aren't quite that simple. I have an object A with socket a and an object B with socket b. Socket a receives a new packet, and the...
The question here is whether something like this already exists or, if not, whether there's a better way to achieve it than what I describe below.
I need to allow an arbitrary Principal (User, Group, Site Admin) to add Event Sinks (like email addresses, Webhook URLs, etc.) to the system (through the web interface) and, for each one, spe...
The aim of the test is to simulate a serious fatal error, peeking into kernel due to the socket failure. It is good practise in cases such as crash-recovery.
9-signalling all postgres processes ignite errors immediately after the command:
$ psql
psql: could not connect to server: Connection refused
Is the server running locally...
I am writing a daemon in c on linux. It traps signals SIGHUP, SIGTERM, SIGINT, and SIGQUIT, logs them using syslog and quits. If it receives SIGSEGV it core dumps. When these occur everything happens as expected but once in a while it quits...does not exit cleanly, does not log the signal, and does not leave a core dump. I am stumped and...
I need to make some clean up before closing my application, but SetConsoleCtrlHandler doesn't seem to be available for Windows CE console applications.
Is there any alternative method for handling Ctrl+C in Windows CE 6?
...
Hello,
I'm doing something like the following:
I run a Perl script which has the following:
# First i install a signal handler for HUP which sets a global flag.
$SIG{"HUP"} = sub { print "HUP received\n"; $received_hup = 1 };
# Now i wait for HUP to be received.
my $cnt = 0;
for ($cnt = 0; $received_hup != 1 and $cnt < 900; $cnt++) {
...
When developing software that records input signals (numbers) in real time, how can this data be best stored and compressed? Would an SQL engine be good for this, permitting fast data mining in the future, or are there other data formats that would be suitable or compressed enough for upto 1000 data samples per second?
I don't mind buil...
Is there any good c++ source codes or api for handling phone lines like understanding tone signals. For example i like to find out if the person enters 3 (it's likely that this is done using it's tone sound).
Do i need a special modem for this purpose or it can be done using only standard modems.
...
One of my colleague told me this morning, when he killed supervisord by "kill -9", the subprocesses of supervisord is not killed.
He is quite sure about that, but I tried many times and did not find that happen.
So when a parent process is killed by "kill -9", will linux ensure that it's sub-processes also been killed?
...
I have a program running on a remote machine which expects to receive SIGINT from the parent. That program needs to receive that signal to function correctly. Unfortunately, if I run that process remotely over SSH and send SIGINT, the ssh process itself traps and interrupts rather than forwarding the signal.
Here's an example of this be...
I want to capture the Control+D signal in my program and write a signal handler for it.
How can I do that?
I am working on C and using a linux system.
...
I am trying to create and emit a GTK signal:
g_signal_new("child-finished",
G_TYPE_OBJECT,
G_SIGNAL_RUN_FIRST,
0,
NULL, NULL,
NULL, // *** I think this is where I need to change it
G_TYPE_NONE, 0);
g_signal_connect(G_OBJECT(myWindow), "child-finished", G_CALLBACK(MyCallback), NULL);
Here is my code th...
There are so many possible errors in POSIX environement. Why some of them (write to unconnected socket in particular) get special treatment in form of signals?
...
How do I catch a ctrl-c event in C++?
...
Hi,
can anybody tell me what happens if multithread program receives SIGSTOP signal during execution of mq_send?
...
For some reason, siginterrupt() only seems to set the behaviour for the first signal received.
In this example program, the first SIGQUIT appears to do nothing, but the second sigquit prints "SIGQUIT Handler" and s.accept() throws an Interrupted system call exception.
from signal import *
from socket import *
import sys
def sigquitHan...
I am writing small debugging program for multithread apps. My idea is to run the target, that is being debuged for for example 100 nanosecs, then pause and examine its memory. However this ( just pseudocode )
nanosleep(100); //sleep debuger for 100 nanosec and let a program run
kill(target_app_pid, SIGSTOP); //stop target ap...