MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / pipe_write

Function pipe_write

kernel/orbis/src/pipe.cpp:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static orbis::ErrorCode pipe_write(orbis::File *file, orbis::Uio *uio,
56 orbis::Thread *thread) {
57 auto pipe = static_cast<orbis::Pipe *>(file)->other;
58 ORBIS_LOG_ERROR(__FUNCTION__, thread->name.c_str(), thread->tid, file);
59
60 std::size_t cnt = 0;
61 for (auto vec : std::span(uio->iov, uio->iovcnt)) {
62 auto offset = pipe->data.size();
63 pipe->data.resize(offset + vec.len);
64 ORBIS_RET_ON_ERROR(orbis::ureadRaw(pipe->data.data(), vec.base, vec.len));
65 cnt += vec.len;
66 }
67
68 pipe->event->emit(orbis::kEvFiltRead);
69 pipe->cv.notify_one(file->mtx);
70 uio->resid -= cnt;
71 uio->offset += cnt;
72
73 ORBIS_LOG_ERROR(__FUNCTION__, thread->name.c_str(), thread->tid, file,
74 uio->resid, uio->offset, file->nextOff, cnt);
75 thread->where();
76 return {};
77}
78
79static orbis::FileOps pipe_ops = {
80 .read = pipe_read,

Callers

nothing calls this directly

Calls 8

ureadRawFunction · 0.85
c_strMethod · 0.80
whereMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45
emitMethod · 0.45
notify_oneMethod · 0.45

Tested by

no test coverage detected