mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 15:29:23 +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)}
|
||||
var ts : timespec;
|
||||
begin
|
||||
ts.tv_sec := timeout div 1000;
|
||||
ts.tv_nsec := (timeout mod 1000) * 1000000;
|
||||
fpPoll:=do_syscall(syscall_nr_ppoll,tsysparam(fds),tsysparam(nfds),
|
||||
tsysparam(@ts),0);
|
||||
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_nsec := (timeout mod 1000) * 1000000;
|
||||
fpPoll:=do_syscall(syscall_nr_ppoll,tsysparam(fds),tsysparam(nfds),
|
||||
tsysparam(@ts),0);
|
||||
end
|
||||
end;
|
||||
{$else}
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user