Clean up some signal usage mainly related to Windows
Tristan Partin <tristan@neon.tech>
From: "Tristan Partin" <tristan@neon.tech>
To: <pgsql-hackers@postgresql.org>
Date: 2023-07-06T20:43:32Z
Lists: pgsql-hackers
Attachments
- v1-0001-Use-signal-safe-functions-in-signal-handler.patch (text/x-patch) patch v1-0001
- v1-0002-Cleanup-some-signal-usage-on-Windows.patch (text/x-patch) patch v1-0002
Windows has support for some signals[0], like SIGTERM and SIGINT. SIGINT must be handled with care on Windows since it is handled in a separate thread. SIGTERM however can be handled in a similar way to UNIX-like systems. I audited a few pqsignal calls that were blocked by WIN32 to see if they could become used, and made some adjustments. Definitely hoping for someone with more Windows knowledge to audit this. In addition, I found that signal_cleanup() in pg_test_fsync.c was not using signal-safe functions, so I went ahead and fixed those to use their signal-safe equivalents. [0]: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/signal -- Tristan Partin Neon (https://neon.tech)
Commits
-
Suppress -Wunused-result warning about write().
- c2a465b2c94f 17.0 landed
-
Use signal-safe functions in signal handler
- 52e98d450230 17.0 landed