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

Method write

source/kernel/kprocess.cpp:1129–1141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1127}
1128
1129U32 KProcess::write(KThread* thread, FD fildes, U32 bufferAddress, U32 bufferLen) {
1130 KFileDescriptorPtr fd = this->getFileDescriptor(fildes);
1131 if (!fd) {
1132 return -K_EBADF;
1133 }
1134 if (!fd->canWrite()) {
1135 return -K_EINVAL;
1136 }
1137 if (!memory->canRead(bufferAddress, bufferLen)) {
1138 return -K_EFAULT;
1139 }
1140 return fd->kobject->write(thread, bufferAddress, bufferLen);
1141}
1142
1143U32 KProcess::brk(KThread* thread, U32 address) {
1144 if (address > this->brkEnd) {

Callers

nothing calls this directly

Calls 3

getFileDescriptorMethod · 0.95
canWriteMethod · 0.45
canReadMethod · 0.45

Tested by

no test coverage detected