6
UNIX Signals and File Systems
At the heart of every UNIX system lies a balance between structure and interruption. File systems embody order: they organize data into hierarchies, enforce permissions, and preserve information over time. Signals, by contrast, introduce disruption. A signal is an asynchronous notification sent by the operating system to a process to indicate that an event has occurred — for example, when a user presses Ctrl + C (SIGINT) or when the system requests termination (SIGTERM). Programs must be prepared to handle such events gracefully, even when they arrive unexpectedly. In this chapter, we begin by exploring how Go allows us to intercept and handle UNIX signals so that our programs can respond cleanly — printing progress ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access