MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / fwrite

Method fwrite

source/core/StarFile_unix.cpp:246–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246size_t File::fwrite(void* file, char const* data, size_t len) {
247 if (len == 0)
248 return 0;
249
250 auto fd = fdFromHandle(file);
251 auto ret = ::write(fd, data, len);
252 if (ret < 0) {
253 if (errno == EAGAIN || errno == EINTR)
254 return 0;
255 throw IOException::format("Write error: {}", strerror(errno));
256 } else {
257 return ret;
258 }
259}
260
261void File::fsync(void* file) {
262 auto fd = fdFromHandle(file);

Callers

nothing calls this directly

Calls 3

fdFromHandleFunction · 0.85
writeFunction · 0.85
formatFunction · 0.70

Tested by

no test coverage detected