PragmaTwice commented on code in PR #1045:
URL:
https://github.com/apache/incubator-kvrocks/pull/1045#discussion_r1005153565
##########
src/common/util.cc:
##########
@@ -672,4 +672,28 @@ int aeWait(int fd, int mask, uint64_t timeout) {
return retval;
}
}
+
+Status Write(int fd, const std::string &data) {
+ ssize_t n = 0;
+ while (n < static_cast<ssize_t>(data.size())) {
+ ssize_t nwritten = write(fd, data.c_str() + n, data.size() - n);
+ if (nwritten == -1) {
+ return Status(Status::NotOK, strerror(errno));
+ }
+ n += nwritten;
+ }
+ return Status::OK();
+}
+
+Status Pwrite(int fd, const std::string &data, std::istream::off_type offset) {
Review Comment:
```suggestion
Status Pwrite(int fd, const std::string &data, off_t offset) {
```
This function is not related to `std::istream`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]