mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 16:49:23 +02:00
* EPoll_Event is packed only on x86-64, not other 64 Bit CPUs, resolves #34416
* epoll_pwait expects the SigSet size as sixth parameter (kernel syscall only) + simple epoll* test git-svn-id: trunk@44093 -
This commit is contained in:
parent
e7f5b89c2c
commit
2b7447c78d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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/twide6fpwidestring.pp svneol=native#text/pascal
|
||||||
tests/test/units/fpwidestring/twide7fpwidestring.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/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/linux/tstatx.pp svneol=native#text/pascal
|
||||||
tests/test/units/math/tcmpnan.pp svneol=native#text/plain
|
tests/test/units/math/tcmpnan.pp svneol=native#text/plain
|
||||||
tests/test/units/math/tdivmod.pp svneol=native#text/plain
|
tests/test/units/math/tdivmod.pp svneol=native#text/plain
|
||||||
|
@ -279,7 +279,8 @@ type
|
|||||||
TEPoll_Data = Epoll_Data;
|
TEPoll_Data = Epoll_Data;
|
||||||
PEPoll_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;
|
Events: cuint32;
|
||||||
Data : TEpoll_Data;
|
Data : TEpoll_Data;
|
||||||
end;
|
end;
|
||||||
@ -622,7 +623,7 @@ function epoll_wait(epfd: cint; events: pepoll_event; maxevents, timeout: cint):
|
|||||||
begin
|
begin
|
||||||
{$if defined(generic_linux_syscalls)}
|
{$if defined(generic_linux_syscalls)}
|
||||||
epoll_wait := do_syscall(syscall_nr_epoll_pwait, tsysparam(epfd),
|
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}
|
{$else}
|
||||||
epoll_wait := do_syscall(syscall_nr_epoll_wait, tsysparam(epfd),
|
epoll_wait := do_syscall(syscall_nr_epoll_wait, tsysparam(epfd),
|
||||||
tsysparam(events), tsysparam(maxevents), tsysparam(timeout));
|
tsysparam(events), tsysparam(maxevents), tsysparam(timeout));
|
||||||
|
24
tests/test/units/linux/tepoll1.pp
Normal file
24
tests/test/units/linux/tepoll1.pp
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user