This is a partial merge of #6750. I took the Posix code paths and
dropped the Windows code paths, and then did the improvements noted in
the comments.
The Windows implementation is still TODO.
e54fd25781Andrew Kelley committed on 12/29/2020, 6:16:28 PMparents1590ed9717cf00