* nanosleep for sleep(), since it is now in the POSIX group.

git-svn-id: trunk@1341 -
This commit is contained in:
marco 2005-10-09 11:41:57 +00:00
parent 8f50bb556e
commit f054a6df16

View File

@ -259,7 +259,7 @@ begin
fpclose(Handle);
end;
Function FileTruncate (Handle,Size: Longint) : boolean;
Function FileTruncate (Handle,Size: TFileOffset) : boolean;
begin
FileTruncate:=fpftruncate(Handle,Size)>=0;
@ -1057,22 +1057,12 @@ End;
procedure Sleep(milliseconds: Cardinal);
Var
fd : Integer;
fds : TfdSet;
timeout : TimeVal;
timeout,timeoutresult : TTimespec;
begin
fd:=FileOpen('/dev/null',fmOpenRead);
If Not(Fd<0) then
try
fpfd_zero(fds);
fpfd_set(0,fds);
timeout.tv_sec:=Milliseconds div 1000;
timeout.tv_usec:=(Milliseconds mod 1000) * 1000;
fpSelect(1,Nil,Nil,@fds,@timeout);
finally
FileClose(fd);
end;
timeout.tv_sec:=milliseconds div 1000;
timeout.tv_nsec:=1000*1000*(milliseconds mod 1000);
fpnanosleep(@timeout,@timeoutresult);
end;
Function GetLastOSError : Integer;