| 1075 | } |
| 1076 | |
| 1077 | U32 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 | |
| 1091 | U32 KProcess::sendFile(U32 outFd, U32 inFd, U32 offset, U32 count) { |
| 1092 | BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(fdsMutex); |
nothing calls this directly
no test coverage detected