MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / read

Method read

system/lib/wasmfs/pipe_backend.h:36–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 }
35
36 ssize_t read(uint8_t* buf, size_t len, off_t offset) override {
37 for (size_t i = 0; i < len; i++) {
38 if (data->empty()) {
39 return i;
40 }
41 buf[i] = data->front();
42 data->pop();
43 }
44 return len;
45 }
46
47 int flush() override { return 0; }
48

Callers 3

mainFunction · 0.45
readAtOffsetFunction · 0.45
_mmap_jsFunction · 0.45

Calls 3

emptyMethod · 0.45
frontMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected