| 133 | } |
| 134 | |
| 135 | U32 kgetsockname(KThread* thread, U32 socket, U32 address, U32 plen) { |
| 136 | KFileDescriptorPtr fd = thread->process->getFileDescriptor(socket); |
| 137 | |
| 138 | if (!fd) { |
| 139 | return -K_EBADF; |
| 140 | } |
| 141 | if (IS_NOT_SOCKET(fd)) { |
| 142 | return -K_ENOTSOCK; |
| 143 | } |
| 144 | std::shared_ptr<KSocketObject> s = std::dynamic_pointer_cast<KSocketObject>(fd->kobject); |
| 145 | return s->getsockname(thread, fd, address, plen); |
| 146 | } |
| 147 | |
| 148 | U32 kgetpeername(KThread* thread, U32 socket, U32 address, U32 plen) { |
| 149 | KFileDescriptorPtr fd = thread->process->getFileDescriptor(socket); |
no test coverage detected