diff --git a/.gitattributes b/.gitattributes index 1bd538b6ec..7588b1025b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15638,6 +15638,7 @@ tests/test/units/fpwidestring/twide2fpwidestring.pp svneol=native#text/pascal tests/test/units/fpwidestring/twide6fpwidestring.pp svneol=native#text/pascal tests/test/units/fpwidestring/twide7fpwidestring.pp svneol=native#text/pascal tests/test/units/lineinfo/tlininfo.pp svneol=native#text/plain +tests/test/units/linux/tepoll1.pp svneol=native#text/pascal tests/test/units/linux/tstatx.pp svneol=native#text/pascal tests/test/units/math/tcmpnan.pp svneol=native#text/plain tests/test/units/math/tdivmod.pp svneol=native#text/plain diff --git a/rtl/linux/linux.pp b/rtl/linux/linux.pp index f912440935..90c0831786 100644 --- a/rtl/linux/linux.pp +++ b/rtl/linux/linux.pp @@ -279,7 +279,8 @@ type TEPoll_Data = Epoll_Data; PEPoll_Data = ^Epoll_Data; - EPoll_Event = {$ifdef cpu64} packed {$endif} record + { x86_64 uses a packed record so it is compatible with i386 } + EPoll_Event = {$ifdef cpux86_64} packed {$endif} record Events: cuint32; Data : TEpoll_Data; end; @@ -622,7 +623,7 @@ function epoll_wait(epfd: cint; events: pepoll_event; maxevents, timeout: cint): begin {$if defined(generic_linux_syscalls)} epoll_wait := do_syscall(syscall_nr_epoll_pwait, tsysparam(epfd), - tsysparam(events), tsysparam(maxevents), tsysparam(timeout),0); + tsysparam(events), tsysparam(maxevents), tsysparam(timeout),0,sizeof(TSigSet)); {$else} epoll_wait := do_syscall(syscall_nr_epoll_wait, tsysparam(epfd), tsysparam(events), tsysparam(maxevents), tsysparam(timeout)); diff --git a/tests/test/units/linux/tepoll1.pp b/tests/test/units/linux/tepoll1.pp new file mode 100644 index 0000000000..de5d236da2 --- /dev/null +++ b/tests/test/units/linux/tepoll1.pp @@ -0,0 +1,24 @@ +{ %target=linux } +uses + baseunix,linux,ctypes; + +var + e : tepoll_event; + es : array[0..10] of tepoll_event; + fd : cint; + i : Longint; +begin + fillchar(es,sizeof(es),$de); + fd:=epoll_create(1); + + e.Events:=EPOLLIN; + e.Data.u32:=$1234568; + if (epoll_ctl(fd,EPOLL_CTL_ADD,0,@e)<>0) then + begin + writeln('Error in epoll_ctl'); + fpclose(fd); + halt(1); + end; + i:=epoll_wait(fd,@es,length(es),100); + fpclose(fd); +end.