MCPcopy Create free account
hub / github.com/apache/trafficserver / pwrite

Method pwrite

src/iocore/aio/AIO_fault_injection.cc:102–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102ssize_t
103AIOFaultInjection::pwrite(int fd, const void *buf, size_t n, off_t offset)
104{
105 std::lock_guard<std::mutex> lock{_mutex};
106 IOFault result = _op_result(fd);
107 ssize_t ret = 0;
108 if (result.skip_io) {
109 ink_release_assert(result.err_no != 0);
110 } else {
111 ret = ::pwrite(fd, buf, n, offset);
112 if (ret < 0 && (errno == EINTR || errno == ENOBUFS || errno == ENOMEM)) {
113 // caller will retry
114 _decrement_op_count(fd);
115 }
116 }
117 if (result.err_no != 0) {
118 errno = result.err_no;
119 ret = -1;
120 }
121 return ret;
122}

Callers 1

cache_opFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected