Skip to content
Permalink
Browse files

ensure clock_gettime() Posix API is checked at startup

  • Loading branch information
Arnaud Bouchez
Arnaud Bouchez committed Feb 7, 2020
1 parent 427209e commit c69f2fb2d070520746e0e42c2105795c47525426
Showing with 7 additions and 2 deletions.
  1. +6 −1 SynFPCLinux.pas
  2. +1 −1 SynopseCommit.inc
@@ -560,7 +560,8 @@ procedure GetKernelRevision;
if fpuname(uts)=0 then begin
P := @uts.release[0];
KernelRevision := GetNext shl 16+GetNext shl 8+GetNext;
end;
end else
uts.release[0] := #0;
{$ifdef DARWIN}
mach_timebase_info(mach_timeinfo);
mach_timecoeff := mach_timeinfo.Numer/mach_timeinfo.Denom;
@@ -572,6 +573,10 @@ procedure GetKernelRevision;
CLOCK_REALTIME_FAST := CLOCK_REALTIME_COARSE;
if clock_gettime(CLOCK_MONOTONIC_COARSE, @tp) = 0 then
CLOCK_MONOTONIC_FAST := CLOCK_MONOTONIC_COARSE;
if (clock_gettime(CLOCK_REALTIME_FAST,@tp)<>0) or // paranoid check
(clock_gettime(CLOCK_MONOTONIC_FAST,@tp)<>0) then
raise Exception.CreateFmt('clock_gettime() not supported by %s kernel - errno=%d',
[PAnsiChar(@uts.release),GetLastError]);
{$endif LINUX}
{$endif DARWIN}
end;
@@ -1 +1 @@
'1.18.5458'
'1.18.5459'

0 comments on commit c69f2fb

Please sign in to comment.
You can’t perform that action at this time.