oocSysClock now don't use C calls, but use Unix.Mod instead.

Unix.Mod modified, Gettimeofday now returns value.
Kernel.Mod modified in order to conform to Unix.Mod new interface


Former-commit-id: 13da72a3ac
This commit is contained in:
Norayr Chilingarian 2013-10-30 19:55:27 +04:00
parent 8b8f4591be
commit ad9eb05779
8 changed files with 30 additions and 48 deletions

View file

@ -84,8 +84,9 @@ MODULE Kernel;
PROCEDURE GetClock* (VAR t, d: LONGINT);
VAR tv: Unix.Timeval; tz: Unix.Timezone; time: RealTime;
l : LONGINT;
BEGIN
Unix.Gettimeofday(tv, tz);
l := Unix.Gettimeofday(tv, tz);
time := localtime(tv.sec);
t := time.sec + ASH(time.min, 6) + ASH(time.hour, 12);
d := time.mday + ASH(time.mon+1, 5) + ASH(time.year MOD 100, 9);
@ -98,8 +99,9 @@ MODULE Kernel;
PROCEDURE Time*(): LONGINT;
VAR timeval: Unix.Timeval; timezone: Unix.Timezone;
l : LONGINT;
BEGIN
Unix.Gettimeofday(timeval, timezone);
l := Unix.Gettimeofday(timeval, timezone);
RETURN (timeval.usec DIV 1000 + timeval.sec * 1000 - timeStart) MOD 7FFFFFFFH
END Time;