| 1127 | } |
| 1128 | |
| 1129 | U32 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 | |
| 1143 | U32 KProcess::brk(KThread* thread, U32 address) { |
| 1144 | if (address > this->brkEnd) { |
nothing calls this directly
no test coverage detected