| 133 | } |
| 134 | |
| 135 | U32 kpoll(KThread* thread, U32 pfds, U32 nfds, U32 timeout) { |
| 136 | U32 address = pfds; |
| 137 | KMemory* memory = thread->memory; |
| 138 | |
| 139 | KPollData* pollData = new KPollData[nfds]; |
| 140 | |
| 141 | for (U32 i=0;i<nfds;i++) { |
| 142 | pollData[i].fd = memory->readd(address); address += 4; |
| 143 | pollData[i].events = memory->readw(address); address += 2; |
| 144 | pollData[i].revents = memory->readw(address); address += 2; |
| 145 | } |
| 146 | |
| 147 | S32 result = internal_poll(thread, pollData, nfds, timeout); |
| 148 | if (result >= 0) { |
| 149 | pfds+=6; |
| 150 | for (U32 i=0;i<nfds;i++) { |
| 151 | memory->writew(pfds, pollData[i].revents); |
| 152 | pfds+=8; |
| 153 | } |
| 154 | } |
| 155 | delete[] pollData; |
| 156 | return result; |
| 157 | } |
| 158 | |
| 159 | |
| 160 | U32 kselect(KThread* thread, U32 nfds, U32 readfds, U32 writefds, U32 errorfds, U32 timeout, bool timeoutIsTimeVal, U32 sigmask, bool time64) { |
no test coverage detected