[[!comment format=mdwn
 username="joey"
 subject="""comment 6"""
 date="2025-09-04T18:24:33Z"
 content="""
`openFile` is not the only one that would need to be dealt with.
Also `withFile`, `openBinaryFile`, `withBinaryFile`, `appendFile`,
and `openTempFile`, `readFile`, and `writeFile` (including `L.` versions).

Since none of those provide a way to set CloseOnExec, they would have
to be changed to be implemented using `openFd` with CloseOnExec, and
then mkHandleFromFD. Or rewritten to use
<https://hackage.haskell.org/package/file-io-0.1.5/docs/src/System.File.OsPath.Internal.html#openFileWithCloseOnExec>

I have checked and none of those are ever used to create a handle that is
intentionally passed to a child process. The only uses of `handleToFd`
result in a FD that gets dupped to another FD number, and dup() does not
inherit the close-on-exec flag. So it should be safe to just write new
versions of all of those.

Also there are a few uses of `openFd` that don't set CloseOnExec.
"""]]
