mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 14:29:21 +02:00
* fixed ppoll for infinite timeouts (patch by Edmund Grimley Evans)
git-svn-id: trunk@31042 -
This commit is contained in:
parent
ab43e07320
commit
e54d0a41af
@ -492,10 +492,15 @@ function fpPoll(fds: ppollfd; nfds: cuint; timeout: clong): cint;
|
|||||||
{$if defined(generic_linux_syscalls)}
|
{$if defined(generic_linux_syscalls)}
|
||||||
var ts : timespec;
|
var ts : timespec;
|
||||||
begin
|
begin
|
||||||
|
if timeout<0 then
|
||||||
|
fpPoll:=do_syscall(syscall_nr_ppoll,tsysparam(fds),tsysparam(nfds),0,0)
|
||||||
|
else
|
||||||
|
begin
|
||||||
ts.tv_sec := timeout div 1000;
|
ts.tv_sec := timeout div 1000;
|
||||||
ts.tv_nsec := (timeout mod 1000) * 1000000;
|
ts.tv_nsec := (timeout mod 1000) * 1000000;
|
||||||
fpPoll:=do_syscall(syscall_nr_ppoll,tsysparam(fds),tsysparam(nfds),
|
fpPoll:=do_syscall(syscall_nr_ppoll,tsysparam(fds),tsysparam(nfds),
|
||||||
tsysparam(@ts),0);
|
tsysparam(@ts),0);
|
||||||
|
end
|
||||||
end;
|
end;
|
||||||
{$else}
|
{$else}
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user