MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / kpoll

Function kpoll

source/kernel/kpoll.cpp:135–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135U32 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
160U32 kselect(KThread* thread, U32 nfds, U32 readfds, U32 writefds, U32 errorfds, U32 timeout, bool timeoutIsTimeVal, U32 sigmask, bool time64) {

Callers 1

syscall_pollFunction · 0.85

Calls 4

internal_pollFunction · 0.85
readdMethod · 0.45
readwMethod · 0.45
writewMethod · 0.45

Tested by

no test coverage detected