Rewriting the GNU Coreutils in Rust
Rewriting the GNU Coreutils in Rust
Posted Jun 10, 2021 7:50 UTC (Thu) by Sesse (subscriber, #53779)In reply to: Rewriting the GNU Coreutils in Rust by epa
Parent article: Rewriting the GNU Coreutils in Rust
Say that you have some long-running computation that you want to be able to abort cleanly. Now further assume that your thread is stuck in a syscall; say either waiting for a write to file on NFS, or waiting for data from socket. Let's say a recvfrom(). You trap SIGINT, and in your handler, you set a “please shut down” flag. (You can't do much else in a signal handler!) Now, if this didn't abort your recvfrom() with an EINTR, how would you ever get to actually check that flag and shut down?
