MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / writev

Method writev

source/kernel/kobject.cpp:25–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25U32 KObject::writev(KThread* thread, U32 iov, S32 iovcnt) {
26 U32 len=0;
27 KMemory* memory = thread->memory;
28
29 for (S32 i=0;i<iovcnt;i++) {
30 U32 buf = memory->readd(iov + i * 8);
31 U32 toWrite = memory->readd(iov + i * 8 + 4);
32 S32 result;
33
34 result = this->write(thread, buf, toWrite);
35 if (result<0) {
36 if (i>0) {
37 kwarn("writev partial fail: TODO file pointer should not change");
38 }
39 return result;
40 }
41 len+=result;
42 }
43 return len;
44}
45
46U32 KObject::read(KThread* thread, U32 address, U32 len) {
47 U32 result = 0;

Callers 1

syscall_writevFunction · 0.45

Calls 3

writeMethod · 0.95
kwarnFunction · 0.85
readdMethod · 0.45

Tested by

no test coverage detected