<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>signals on toorun.dev</title><link>https://toorun.dev/tags/signals/</link><description>Recent content in signals on toorun.dev</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sat, 25 Jul 2026 11:00:00 +0000</lastBuildDate><atom:link href="https://toorun.dev/tags/signals/index.xml" rel="self" type="application/rss+xml"/><item><title>Linux Signals: Custom Ctrl+C Handler (SIGINT, SIGUSR1, SIGALRM)</title><link>https://toorun.dev/posts/linux-signals-ctrl-c-handler-sigint-sigalrm-sigusr1/</link><pubDate>Sat, 25 Jul 2026 11:00:00 +0000</pubDate><guid>https://toorun.dev/posts/linux-signals-ctrl-c-handler-sigint-sigalrm-sigusr1/</guid><description>Linux Signals: Custom Ctrl+C Handler (Short Practical Guide) In Linux/embedded Linux, signals are useful for lightweight control events. Typical use: stop, reload, notify, timeout.
This example shows:
Custom Ctrl+C (SIGINT) behavior Sending SIGUSR1 to another process Using SIGALRM as a timeout Full short example #include &amp;lt;signal.h&amp;gt; #include &amp;lt;stdio.h&amp;gt; #include &amp;lt;stdlib.h&amp;gt; #include &amp;lt;unistd.h&amp;gt; #define W(msg) write(STDOUT_FILENO, msg, sizeof(msg) - 1) static volatile sig_atomic_t running = 1; static volatile sig_atomic_t got_usr1 = 0; static volatile sig_atomic_t child_pid = -1; static void on_sigint(int sig) { (void)sig; W(&amp;#34;\nSIGINT: Ctrl+C caught.</description></item></channel></rss>