Add async_pipe constructor taking native_handles
Open
- Dominant language
- C++
- Stars
- 145
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Description
async_pipe has native_sink() and native_source() methods, returning native_handles, which can be used to do things like `fcntl(pipe.native_sink(), F_SETFD, FD_CLOEXEC)`.
But, to avoid race conditions, it would be better to directly create the pipe with O_CLOEXEC. I doubt the CLOEXEC concept is portable but, since the interface already exposes native_handles, maybe a constructor could be added taking native_handles? This way people could create the pipe themselves, and then pass it to async_pipe.
I would suggest defaulting to O_CLOEXEC, but that would be a breaking change.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.