implement readvFull() and writevFull() using read()/write() on Windows
Summary: On Windows, implement `readvFull()` and `writevFull()` by calling `read()` and `write()` repeatedly, rather than `readv()` and `writev()`. Windows does not provide native implementations of `readv()` and `writev()`, so the code was previously using implementations provided by folly in `folly/portability/SysUio.cpp`. The folly implementations attempted to lock the file to provide similar atomicity guarantees that `readv()` and `writev()` provide on POSIX. However, callers of `readvFull()` and `writevFull()` don't care about this atomicity (since they are willing to do multiple `readv()` and `writev()` calls if necessary). Therefore this locking behavior is not needed. Locking in this case is undesirable because it adds extra overhead, and fails in some cases. For instance, attempting to lock stderr blocks for 9 seconds before eventually failing. Differential Revision: D21367446 fbshipit-source-id: b2ae3c9c5da977402336c750d3d21ba9825527d9
Showing
Please register or sign in to comment