#include <sys/mman.h> // PROT_*
#include <algorithm>
+#include <cerrno>
+#include <cstring>
#include <memory>
#include <string>
} else if (res == 0)
return -1;
else if (errno != EINTR) {
- perror("pread_whole");
+ XBT_ERROR("pread_whole: %s", strerror(errno));
return -1;
}
}
offset += res;
} else if (res == 0)
return -1;
- else if (errno != EINTR)
+ else if (errno != EINTR) {
+ XBT_ERROR("pwrite_whole: %s", strerror(errno));
return -1;
+ }
}
return real_count;
}