From: Alexander Shiryaev Date: Fri, 6 Dec 2013 17:40:46 +0000 (+0400) Subject: OpenBSD Kernel.Time: clock -> clock_gettime X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=3185552ee2f412a0f0929be11e85ae3139e6c211;p=bbcp.git OpenBSD Kernel.Time: clock -> clock_gettime --- diff --git a/new/_OpenBSD_/Lin/Mod/Libc.txt b/new/_OpenBSD_/Lin/Mod/Libc.txt index 26bf4ac..7df4f73 100644 --- a/new/_OpenBSD_/Lin/Mod/Libc.txt +++ b/new/_OpenBSD_/Lin/Mod/Libc.txt @@ -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; diff --git a/new/_OpenBSD_/Lin/Mod/gen-Libc/Makefile b/new/_OpenBSD_/Lin/Mod/gen-Libc/Makefile index 87f6751..8e8d081 100644 --- a/new/_OpenBSD_/Lin/Mod/gen-Libc/Makefile +++ b/new/_OpenBSD_/Lin/Mod/gen-Libc/Makefile @@ -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 index 0000000..ed5eb09 --- /dev/null +++ b/new/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec @@ -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 diff --git a/new/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c b/new/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c index ac3b925..b2ad10d 100644 --- a/new/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c +++ b/new/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c @@ -3,6 +3,7 @@ #include #include #include +#include #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); diff --git a/new/_OpenBSD_/System/Mod/Kernel.odc b/new/_OpenBSD_/System/Mod/Kernel.odc index ca87b4d..fc065a2 100644 Binary files a/new/_OpenBSD_/System/Mod/Kernel.odc and b/new/_OpenBSD_/System/Mod/Kernel.odc differ diff --git a/new/_OpenBSD_/libBB.so b/new/_OpenBSD_/libBB.so index 8771d75..62b54f7 100644 Binary files a/new/_OpenBSD_/libBB.so and b/new/_OpenBSD_/libBB.so differ diff --git a/new/_OpenBSD_/libBB0.so b/new/_OpenBSD_/libBB0.so index 0051324..aac734e 100644 Binary files a/new/_OpenBSD_/libBB0.so and b/new/_OpenBSD_/libBB0.so differ