mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
poll syscall: add volatile keyword to fd count to prevent a loop from being optimized out
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
#define MAXNFDS 4096
|
||||
|
||||
syscallret syscall_poll(pollfd *fds, size_t nfds, int timeoutms){
|
||||
syscallret syscall_poll(pollfd *fds, volatile int nfds, int timeoutms){
|
||||
syscallret retv;
|
||||
retv.ret = -1;
|
||||
|
||||
@@ -117,8 +117,7 @@ syscallret syscall_poll(pollfd *fds, size_t nfds, int timeoutms){
|
||||
|
||||
size_t eventcount = 0;
|
||||
|
||||
for(uintmax_t i = 0; i < nfds; ++i){
|
||||
|
||||
for(int i = 0; i < nfds; ++i){
|
||||
if(ilist[i].fd < 0)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user