MCPcopy Create free account
hub / github.com/ElementsProject/elements / Read

Method Read

src/leveldb/util/env_posix.cc:114–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 ~PosixSequentialFile() override { close(fd_); }
113
114 Status Read(size_t n, Slice* result, char* scratch) override {
115 Status status;
116 while (true) {
117 ::ssize_t read_size = ::read(fd_, scratch, n);
118 if (read_size < 0) { // Read error.
119 if (errno == EINTR) {
120 continue; // Retry
121 }
122 status = PosixError(filename_, errno);
123 break;
124 }
125 *result = Slice(scratch, read_size);
126 break;
127 }
128 return status;
129 }
130
131 Status Skip(uint64_t n) override {
132 if (::lseek(fd_, n, SEEK_CUR) == static_cast<off_t>(-1)) {

Callers 4

ReadFileToStringFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 2

PosixErrorFunction · 0.85
SliceClass · 0.70

Tested by 3

TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36