Skip to content

Tag: signals

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 o…

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 ho…

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 ignor…