joan2937 / pigpio

pigpio is a C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO).
The Unlicense
1.45k stars 407 forks source link

Improve signal handling. #532

Closed guymcswain closed 1 year ago

guymcswain commented 2 years ago

I. The pigpio library's default signal handler is changed:

The philosophy here is to do only the essential halting of the DMA engines and avoid any functions that are not signal-safe.

II. The default signal handler is installed only for signals:

III. SIGPIPE, SIGCHLD and SIGWINCH are ignored as before.

IV. SIGUSR1, SIGUSR2 are custom handlers as before.

V. API gpioSetSignalFunc() can set / cancel custom handlers on any signal except:

A cancelled signal will have its previous handler, which may be the library's default handler, re-installed.

VI. Upon gpioTerminate(), any signal installed by the library will be restored to its original handler. (issue #341)