Skip to content
Advertisement

Tag: signals

Change child process’ termination signal at runtime

Using clone() to fork a process you can specify the signal a child process should send its parent on death instead the “normal” SIGCHLD. Is it possible to change the set termination signal after the child was created? Either by the child or the parent? Answer I (quickly) scanned Linux’ source for assignments to struct task_struct’s member exit_signal. This seems

Signals in ppoll not handled immediately

I wrote a small ppoll test but I am confused about the signal handling. The man page says: The relationship between poll() and ppoll() is analogous to the relationship between select(2) and pselect(2): like pselect(2), ppoll() allows an application to safely wait until either a file descriptor becomes ready or until a signal is caught. In my case fd changes

Checking if errno != EINTR: what does it mean?

I’ve found this piece of code used several times (also a similar one where it’s used open() instead of write()). Why it is checked if && errno != EINTR here ? Looking for errno on man I found the following text about EINTR, but even if I visited man 7 signal that doesn’t enlighten me. EINTR Interrupted function call (POSIX.1);

Linux Shutdown and Java Shutdown Hook

When I run a Java process in background and I shut down the computer (ArchLinux), will the computer wait some seconds for the termination of my shutdown-hook in Java? Answer A shutdown hook will be called when a call to close the JVM is made. However, there is no guarantee that the hook will be called. The hook might not/won’t

how to alternate continously Signal handler

I want to write a program in c for linux that catchs the first SIGUSR1 signal, ignores the second one and continue in this behaviour (catch-ignore) for the successive SIGUSR1 signals. I wonder how to keep alternating between the two handlers, because once i set the handler to SIG_IGN, the signal will be ignored and I won’t be able to

Advertisement