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

Method read

source/kernel/kprocess.cpp:1077–1089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1075}
1076
1077U32 KProcess::read(KThread* thread, FD fildes, U32 bufferAddress, U32 bufferLen) {
1078 KFileDescriptorPtr fd = this->getFileDescriptor(fildes);
1079 if (!fd) {
1080 return -K_EBADF;
1081 }
1082 if (!fd->canRead()) {
1083 return -K_EINVAL;
1084 }
1085 if (!memory->canWrite(bufferAddress, bufferLen)) {
1086 return -K_EFAULT;
1087 }
1088 return fd->kobject->read(thread, bufferAddress, bufferLen);
1089}
1090
1091U32 KProcess::sendFile(U32 outFd, U32 inFd, U32 offset, U32 count) {
1092 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(fdsMutex);

Callers

nothing calls this directly

Calls 3

getFileDescriptorMethod · 0.95
canReadMethod · 0.45
canWriteMethod · 0.45

Tested by

no test coverage detected