Browse Source

Linux Kernel.Time: clock -> clock_gettime

Alexander Shiryaev 11 years ago
parent
commit
8898153320

+ 4 - 0
BlackBox/_FreeBSDLinuxOpenBSD_Interp/build

@@ -4,6 +4,10 @@
 ConsCompiler.Compile('Lin/Mod', 'Dl.txt')
 ConsCompiler.Compile('Lin/Mod', 'Libc.txt')
 ConsCompiler.Compile('Lin/Mod', 'Iconv.txt')
+
+# Linux only
+ConsCompiler.Compile('Lin/Mod', 'Rt.txt')
+
 DevCompiler.CompileThis Kernel
 
 DevCompiler.CompileThis Files Console Math Strings Meta Dialog

+ 26 - 0
BlackBox/_Linux_/Lin/Mod/Rt.txt

@@ -0,0 +1,26 @@
+MODULE LinRt ["librt.so.1"];
+
+	(*
+		A. V. Shiryaev, 2013.12
+
+		GNU/Linux
+		32-bit
+	*)
+
+	CONST
+		CLOCK_REALTIME* = 0;
+		CLOCK_MONOTONIC* = 1;
+	
+	TYPE
+		time_t* = INTEGER;
+
+		timespec_t* = RECORD [untagged]
+			tv_sec*: time_t; (* seconds *)
+			tv_nsec*: INTEGER (* nanoseconds *)
+		END;
+
+		clockid_t* = INTEGER;
+
+	PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): INTEGER;
+
+END LinRt.

BIN
BlackBox/_Linux_/System/Mod/Kernel.odc


BIN
BlackBox/_Linux_/libBB.so


BIN
BlackBox/_Linux_/libBB0.so


+ 1 - 0
README

@@ -153,6 +153,7 @@ Files:
 		_LinuxOpenBSD_/Comm/Mod/V24.odc: CommV24 implementation for Linux and OpenBSD
 		_OpenBSD_/Comm/Mod/TCP.odc: CommTCP implementation for OpenBSD
 		_Linux_/Comm/Mod/TCP.odc: CommTCP implementation for Linux
+		_Linux_/Lin/Mod/Rt.odc: interface to librt
 
 		{_OpenBSD_,_Linux_}/libBB.so: compiled and linked shared library to run BlackBox
 		{_OpenBSD_,_Linux_}/libBB0.so: compiled, linked and packed shared library to run console interpreter