DEADSOFTWARE

OpenBSD Kernel.Time: clock -> clock_gettime
authorAlexander Shiryaev <aixp@mail.ru>
Fri, 6 Dec 2013 17:40:46 +0000 (21:40 +0400)
committerAlexander Shiryaev <aixp@mail.ru>
Fri, 6 Dec 2013 17:40:46 +0000 (21:40 +0400)
new/_OpenBSD_/Lin/Mod/Libc.txt
new/_OpenBSD_/Lin/Mod/gen-Libc/Makefile
new/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec [new file with mode: 0644]
new/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c
new/_OpenBSD_/System/Mod/Kernel.odc
new/_OpenBSD_/libBB.so
new/_OpenBSD_/libBB0.so

index 26bf4ac831e7a7a5d4230d127dd7a89459fc73f1..7df4f73e3e71556fdeddd73142d4c332d47cb38f 100644 (file)
@@ -365,6 +365,14 @@ MODULE LinLibc ["libc.so.70.0"];
                O_DIRECTORY* = {17}; (* fail if not a directory *)
 
 
+               CLOCK_REALTIME* = 0;
+               CLOCK_VIRTUAL* = 1;
+               CLOCK_PROCESS_CPUTIME_ID* = 2;
+               CLOCK_MONOTONIC* = 3;
+               CLOCK_THREAD_CPUTIME_ID* = 4;
+               CLOCK_UPTIME* = 5;
+
+
        TYPE
                StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
                PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
@@ -379,6 +387,7 @@ MODULE LinLibc ["libc.so.70.0"];
                ssize_t* = INTEGER;
                off_t* = LONGINT;
                clock_t* = LONGINT;
+               clockid_t* = INTEGER;
                time_t* = LONGINT;
                mode_t* = SET;
                pid_t* = INTEGER;
@@ -564,6 +573,12 @@ MODULE LinLibc ["libc.so.70.0"];
                                d_name*: ARRAY [untagged] 255 + 1 OF SHORTCHAR;
                END;
 
+               timespec_t* = RECORD [untagged]
+                       (* OpenBSD 5.4 /usr/include/time.h *)
+                               tv_sec*: time_t; (* seconds *)
+                               tv_nsec*: long; (* and nanoseconds *)
+               END;
+
 (*
        VAR
                stdin*: INTEGER;
@@ -594,6 +609,9 @@ MODULE LinLibc ["libc.so.70.0"];
        (* ANSI C 89 *)
                PROCEDURE [ccall] clock* (): clock_t;
 
+       (* POSIX.1 *)
+               PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): int;
+
        PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid;
        (* BSD *)
                PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int;
index 87f675119f38755b4c239954871722ef15631498..8e8d081d58308a2c73e6a1a854bb73b51408dc87 100644 (file)
@@ -8,11 +8,11 @@ INCDIR ?= /usr/include
 
 PY = python2.7
 
-DEFS = clockspersec defs-map defs-prot defs-sigmask nsig defs-signo defs-fpe defs-sa defs-errno namemax defs-fcntlo defs-basictypes defs-sc
+DEFS = clockspersec defs-map defs-prot defs-sigmask nsig defs-signo defs-fpe defs-sa defs-errno namemax defs-fcntlo defs-basictypes defs-sc defs-clockid
 
 all: Libc.txt ${DEFS} strerrnocase.txt
 
-Libc.txt: Libc.txt.templ ${DEFS} libver osname machine custom fields-dirent fields-sigaction fields-siginfo fields-stack fields-stat fields-tm fields-ucontext
+Libc.txt: Libc.txt.templ ${DEFS} libver osname machine custom fields-dirent fields-sigaction fields-siginfo fields-stack fields-stat fields-tm fields-ucontext fields-timespec
        ${PY} ./untempl.py Libc.txt.templ ${.TARGET}
 
 clockspersec:
@@ -59,6 +59,9 @@ defs-basictypes: sizeofs
 defs-sc:
        ./dumpdefs.py 2 1 i ${INCDIR}/unistd.h | grep _SC_ > ${.TARGET}
 
+defs-clockid:
+       ./dumpdefs.py 2 1 i ${INCDIR}/sys/_time.h | grep CLOCK_ > ${.TARGET}
+
 #defs-madv:
 #      ./dumpdefs.py 2 0 i ${INCDIR}/sys/mman.h | grep MADV > ${.TARGET}
 #      ./dumpdefs.py 2 1 i ${INCDIR}/sys/mman.h | grep MADV >> ${.TARGET}
diff --git a/new/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec b/new/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec
new file mode 100644 (file)
index 0000000..ed5eb09
--- /dev/null
@@ -0,0 +1,3 @@
+                       (* OpenBSD 5.4 /usr/include/time.h *)
+                               tv_sec*: time_t; (* seconds *)
+                               tv_nsec*: long; (* and nanoseconds *)
\ No newline at end of file
index ac3b9255ff4a27cd7216d99b413a0d9ab80a4d6a..b2ad10d85d4e755ce7aebcda13b4ae5615897d67 100644 (file)
@@ -3,6 +3,7 @@
 #include <setjmp.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <time.h>
 
 #define TABS "\t\t"
 
@@ -59,6 +60,7 @@ int main ()
        D("ssize_t", sizeof(ssize_t), FALSE, TRUE);
        D("off_t", sizeof(off_t), FALSE, TRUE);
        D("clock_t", sizeof(clock_t), FALSE, TRUE);
+       D("clockid_t", sizeof(clockid_t), FALSE, TRUE);
        D("time_t", sizeof(time_t), FALSE, TRUE);
        D("mode_t", sizeof(mode_t), TRUE, TRUE);
        D("pid_t", sizeof(pid_t), FALSE, TRUE);
index ca87b4d782b923b73538b416b54987658fc366f5..fc065a2d539d4a00231ff6eb9df46e048c3e729d 100644 (file)
Binary files a/new/_OpenBSD_/System/Mod/Kernel.odc and b/new/_OpenBSD_/System/Mod/Kernel.odc differ
index 8771d75c4410ff1182a9e147f150f83248683d17..62b54f7b1c9854587eef94bc8f87185c44e89843 100644 (file)
Binary files a/new/_OpenBSD_/libBB.so and b/new/_OpenBSD_/libBB.so differ
index 005132419ed0e3430e3eaf2390f5a8d524cc585e..aac734ed6e0e17bc54928f51841850227ca489a8 100644 (file)
Binary files a/new/_OpenBSD_/libBB0.so and b/new/_OpenBSD_/libBB0.so differ