| 644 | } |
| 645 | |
| 646 | U32 KNetLinkObject::recvfrom(KThread* thread, const KFileDescriptorPtr& fd, U32 buffer, U32 length, U32 flags, U32 address, U32 address_len) { |
| 647 | if (address == 0) { |
| 648 | if (flags) { |
| 649 | kpanic_fmt("KUnixSocketObject::recvfrom unhandled flags=%x", flags); |
| 650 | } |
| 651 | return read(thread, buffer, length); |
| 652 | } |
| 653 | if (address) { |
| 654 | if (afBound) { |
| 655 | KMemory* memory = thread->memory; |
| 656 | memory->writew(address, this->afBound->nl_family); |
| 657 | memory->writew(address + 2, 0); |
| 658 | memory->writed(address + 4, 0); // pid from kernel |
| 659 | memory->writed(address + 8, this->afBound->nl_groups); |
| 660 | } |
| 661 | } |
| 662 | return read(thread, buffer, length); |
| 663 | } |