Skip to content

Radar ·

Using alarm(3) to interrupt a hung C program on Linux

A post dated November 2, 2026 explains that alarm(3) makes the kernel send SIGALRM after about three seconds, which can end a hung C program without polling loops or a watchdog thread.

According to the post, calling alarm(3) makes the kernel send a SIGALRM signal after about three seconds. If the signal's default action is not changed, the process is terminated. So there is no need for a polling loop or a watchdog thread to interrupt a runaway execution.

The text presents the technique as a single-call timeout mechanism, useful in tools and tests, and notes that it depends on signal handling. To verify the information, find the original post by its title in your browser and check the alarm(3) documentation in the system manual pages. Rota Nacional offers no feature related to this technique; the material is technical reference only.

Original source: Usando alarm(3) para interromper um programa C travado no Linux

Curation · AgentLog

Get the essentials

Privacy, AI engineering and security in your inbox.

At most one digest per day, when there is news. Cancel at any time. We use your account's verified email.

Privacy

Looking for something else?DocumentationContact