On Windows the count argument to read and write is unsigned, so convert it from size_t preventing integer overflow.
| 60 | // On Windows the count argument to read and write is unsigned, so convert |
| 61 | // it from size_t preventing integer overflow. |
| 62 | inline unsigned convert_rwcount(std::size_t count) { |
| 63 | return count <= UINT_MAX ? static_cast<unsigned>(count) : UINT_MAX; |
| 64 | } |
| 65 | #else |
| 66 | // Return type of read and write functions. |
| 67 | using RWResult = ssize_t; |