Supplemental Reading for Windows Signal

Published: (February 17, 2026 at 07:15 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Signal

Sets interrupt signal handling.

Syntax

void __cdecl *signal(int sig, int (*func)(int, int));

Parameters

  • sig – Signal value.
  • func – Pointer to the function to be executed. The first parameter of the function is a signal value, and the second parameter is a subcode that can be used when the first parameter is SIGFPE.

Remarks

The signal function enables a process to choose one of several ways to handle an interrupt signal from the operating system. The sig argument is the interrupt to which signal responds; it must be one of the following manifest constants, which are defined in SIGNAL.H.

sig valueDescription
SIGABRTAbnormal termination
SIGFPEFloating‑point error
SIGILLIllegal instruction
SIGINTCTRL+C signal
SIGSEGVIllegal storage access
SIGTERMTermination request

If sig isn’t one of the above values, the invalid‑parameter handler is invoked, as defined in Parameter validation. If execution is allowed to continue, this function sets errno to EINVAL and returns SIG_ERR.

By default, signal terminates the calling program with exit code 3, regardless of the value of sig.

0 views
Back to Blog

Related posts

Read more »

OpenClaw Is Unsafe By Design

OpenClaw Is Unsafe By Design The Cline Supply‑Chain Attack Feb 17 A popular VS Code extension, Cline, was compromised. The attack chain illustrates several AI‑...