| 221 | } |
| 222 | |
| 223 | U32 krecv(KThread* thread, U32 socket, U32 buffer, U32 len, U32 flags) { |
| 224 | KFileDescriptorPtr fd = thread->process->getFileDescriptor(socket); |
| 225 | |
| 226 | if (!fd) { |
| 227 | return -K_EBADF; |
| 228 | } |
| 229 | if (IS_NOT_SOCKET(fd)) { |
| 230 | return -K_ENOTSOCK; |
| 231 | } |
| 232 | std::shared_ptr<KSocketObject> s = std::dynamic_pointer_cast<KSocketObject>(fd->kobject); |
| 233 | return s->recvfrom(thread, fd, buffer, len, flags, 0, 0); |
| 234 | } |
| 235 | |
| 236 | U32 kshutdown(KThread* thread, U32 socket, U32 how) { |
| 237 | KFileDescriptorPtr fd = thread->process->getFileDescriptor(socket); |
no test coverage detected