소스 검색

FreeBSD 11.0

Alexander Shiryaev 8 년 전
부모
커밋
1adff3239e

+ 36 - 8
BlackBox/_FreeBSD_/Lin/Mod/Libc.txt

@@ -18,9 +18,8 @@ MODULE LinLibc ["libc.so.7"];
 		MAP_SHARED* = {0}; (* share changes *)
 		MAP_SHARED* = {0}; (* share changes *)
 		MAP_PRIVATE* = {1}; (* changes are private *)
 		MAP_PRIVATE* = {1}; (* changes are private *)
 		MAP_FIXED* = {4}; (* map addr must be exactly as requested *)
 		MAP_FIXED* = {4}; (* map addr must be exactly as requested *)
-		MAP_COPY* = MAP_PRIVATE; (* Obsolete *)
-		MAP_RENAME* = {5}; (* Sun: rename private pages to file *)
-		MAP_NORESERVE* = {6}; (* Sun: don't reserve needed swap area *)
+		MAP_RESERVED0020* = {5}; (* previously unimplemented MAP_RENAME *)
+		MAP_RESERVED0040* = {6}; (* previously unimplemented MAP_NORESERVE *)
 		MAP_RESERVED0080* = {7}; (* previously misimplemented MAP_INHERIT *)
 		MAP_RESERVED0080* = {7}; (* previously misimplemented MAP_INHERIT *)
 		MAP_RESERVED0100* = {8}; (* previously unimplemented MAP_NOEXTEND *)
 		MAP_RESERVED0100* = {8}; (* previously unimplemented MAP_NOEXTEND *)
 		MAP_HASSEMAPHORE* = {9}; (* region may contain semaphores *)
 		MAP_HASSEMAPHORE* = {9}; (* region may contain semaphores *)
@@ -28,8 +27,10 @@ MODULE LinLibc ["libc.so.7"];
 		MAP_NOSYNC* = {11}; (* page to but do not sync underlying file *)
 		MAP_NOSYNC* = {11}; (* page to but do not sync underlying file *)
 		MAP_FILE* = {}; (* map from file (default) *)
 		MAP_FILE* = {}; (* map from file (default) *)
 		MAP_ANON* = {12}; (* allocated from memory, swap space *)
 		MAP_ANON* = {12}; (* allocated from memory, swap space *)
+		MAP_EXCL* = {14}; (* for MAP_FIXED, fail if address is used *)
 		MAP_NOCORE* = {17}; (* dont include these pages in a coredump *)
 		MAP_NOCORE* = {17}; (* dont include these pages in a coredump *)
 		MAP_PREFAULT_READ* = {18}; (* prefault mapping for reading *)
 		MAP_PREFAULT_READ* = {18}; (* prefault mapping for reading *)
+		MAP_ALIGNMENT_SHIFT* = {3,4};
 
 
 
 
 		(* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *)
 		(* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *)
@@ -103,6 +104,7 @@ MODULE LinLibc ["libc.so.7"];
 		SIGUSR2* = 31; (* user defined signal 2 *)
 		SIGUSR2* = 31; (* user defined signal 2 *)
 		SIGTHR* = 32; (* reserved by thread library. *)
 		SIGTHR* = 32; (* reserved by thread library. *)
 		SIGLWP* = SIGTHR;
 		SIGLWP* = SIGTHR;
+		SIGLIBRT* = 33; (* reserved by real-time library. *)
 		SIGEV_NONE* = 0; (* No async notification. *)
 		SIGEV_NONE* = 0; (* No async notification. *)
 		SIGEV_SIGNAL* = 1; (* Generate a queued signal. *)
 		SIGEV_SIGNAL* = 1; (* Generate a queued signal. *)
 		SIGEV_THREAD* = 2; (* Call back from another pthread. *)
 		SIGEV_THREAD* = 2; (* Call back from another pthread. *)
@@ -304,11 +306,9 @@ MODULE LinLibc ["libc.so.7"];
 		EDOOFUS* = 88; (* Programming error *)
 		EDOOFUS* = 88; (* Programming error *)
 		ENOTCAPABLE* = 93; (* Capabilities insufficient *)
 		ENOTCAPABLE* = 93; (* Capabilities insufficient *)
 		ECAPMODE* = 94; (* Not permitted in capability mode *)
 		ECAPMODE* = 94; (* Not permitted in capability mode *)
-		ELAST* = 94; (* Must be equal largest errno *)
-		ERESTART* = -1; (* restart syscall *)
-		EJUSTRETURN* = -2; (* don't modify regs, just return *)
-		ENOIOCTL* = -3; (* ioctl not handled by this layer *)
-		EDIRIOCTL* = -4; (* do direct ioctl in GEOM *)
+		ENOTRECOVERABLE* = 95; (* State not recoverable *)
+		EOWNERDEAD* = 96; (* Previous owner died *)
+		ELAST* = 96; (* Must be equal largest errno *)
 
 
 
 
 		NAME_MAX* = 255;
 		NAME_MAX* = 255;
@@ -330,6 +330,7 @@ MODULE LinLibc ["libc.so.7"];
 		O_EXEC* = {18}; (* Open for execute only *)
 		O_EXEC* = {18}; (* Open for execute only *)
 		O_TTY_INIT* = {19}; (* Restore default termios attributes *)
 		O_TTY_INIT* = {19}; (* Restore default termios attributes *)
 		O_CLOEXEC* = {20};
 		O_CLOEXEC* = {20};
+		O_VERIFY* = {21}; (* open only after verification *)
 		O_RDONLY* = {}; (* open for reading only *)
 		O_RDONLY* = {}; (* open for reading only *)
 		O_WRONLY* = {0}; (* open for writing only *)
 		O_WRONLY* = {0}; (* open for writing only *)
 		O_RDWR* = {1}; (* open for reading and writing *)
 		O_RDWR* = {1}; (* open for reading and writing *)
@@ -343,6 +344,22 @@ MODULE LinLibc ["libc.so.7"];
 		O_NOCTTY* = {15}; (* don't assign controlling terminal *)
 		O_NOCTTY* = {15}; (* don't assign controlling terminal *)
 
 
 
 
+		(* FreeBSD 11.0 /usr/include/time.h *)
+			CLOCK_REALTIME* = 0;
+			CLOCK_VIRTUAL* = 1;
+			CLOCK_PROF* = 2;
+			CLOCK_MONOTONIC* = 4;
+			CLOCK_UPTIME* = 5; (* FreeBSD-specific *)
+			CLOCK_UPTIME_PRECISE* = 7; (* FreeBSD-specific *)
+			CLOCK_UPTIME_FAST* = 8; (* FreeBSD-specific *)
+			CLOCK_REALTIME_PRECISE* = 9; (* FreeBSD-specific *)
+			CLOCK_REALTIME_FAST* = 10; (* FreeBSD-specific *)
+			CLOCK_MONOTONIC_PRECISE* = 11; (* FreeBSD-specific *)
+			CLOCK_MONOTONIC_FAST* = 12; (* FreeBSD-specific *)
+			CLOCK_SECOND* = 13; (* FreeBSD-specific *)
+			CLOCK_THREAD_CPUTIME_ID* = 14;
+			CLOCK_PROCESS_CPUTIME_ID* = 15;
+
 	TYPE
 	TYPE
 		StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
 		StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
 		PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
 		PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
@@ -357,6 +374,7 @@ MODULE LinLibc ["libc.so.7"];
 		ssize_t* = INTEGER;
 		ssize_t* = INTEGER;
 		off_t* = LONGINT;
 		off_t* = LONGINT;
 		clock_t* = INTEGER;
 		clock_t* = INTEGER;
+		clockid_t* = INTEGER;
 		time_t* = INTEGER;
 		time_t* = INTEGER;
 		mode_t* = SHORTINT;
 		mode_t* = SHORTINT;
 		pid_t* = INTEGER;
 		pid_t* = INTEGER;
@@ -555,6 +573,12 @@ MODULE LinLibc ["libc.so.7"];
 				d_name*: ARRAY [untagged] 255 + 1 (* 256 *) OF SHORTCHAR;
 				d_name*: ARRAY [untagged] 255 + 1 (* 256 *) OF SHORTCHAR;
 		END;
 		END;
 
 
+		timespec_t* = RECORD [untagged]
+			(* FreeBSD 11.0 /usr/include/sys/_timespec.h *)
+				tv_sec*: time_t; (* seconds *)
+				tv_nsec*: long; (* and nanoseconds *)
+		END;
+
 (*
 (*
 	VAR
 	VAR
 		stdin*: INTEGER;
 		stdin*: INTEGER;
@@ -578,6 +602,9 @@ MODULE LinLibc ["libc.so.7"];
 	(* ANSI C 89 *)
 	(* ANSI C 89 *)
 		PROCEDURE [ccall] clock* (): clock_t;
 		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;
 	PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid;
 	(* BSD *)
 	(* BSD *)
 		PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int;
 		PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int;
@@ -650,6 +677,7 @@ MODULE LinLibc ["libc.so.7"];
 		PROCEDURE [ccall] write* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
 		PROCEDURE [ccall] write* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
 		PROCEDURE [ccall] read* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
 		PROCEDURE [ccall] read* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
 		PROCEDURE [ccall] close* (d: int): int;
 		PROCEDURE [ccall] close* (d: int): int;
+		PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
 
 
 	(* POSIX.1 *)
 	(* POSIX.1 *)
 		PROCEDURE [ccall] sysconf* (name: int): long;
 		PROCEDURE [ccall] sysconf* (name: int): long;

+ 2 - 2
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/Makefile

@@ -20,7 +20,7 @@ clockspersec:
 
 
 defs-map:
 defs-map:
 	./dumpdefs.py 2 1 s ${INCDIR}/sys/mman.h | grep "	MAP_" > ${.TARGET}
 	./dumpdefs.py 2 1 s ${INCDIR}/sys/mman.h | grep "	MAP_" > ${.TARGET}
-	./dumpdefs.py 2 2 s ${INCDIR}/sys/mman.h | grep "	MAP_" >> ${.TARGET}
+	./dumpdefs.py 2 2 s ${INCDIR}/sys/mman.h | grep "	MAP_" | grep -v " = MAP_" >> ${.TARGET}
 
 
 defs-prot:
 defs-prot:
 	./dumpdefs.py 2 1 s ${INCDIR}/sys/mman.h | grep "	PROT_" > ${.TARGET}
 	./dumpdefs.py 2 1 s ${INCDIR}/sys/mman.h | grep "	PROT_" > ${.TARGET}
@@ -41,7 +41,7 @@ defs-sa:
 defs-errno:
 defs-errno:
 	./dumpdefs.py 2 0 i ${INCDIR}/sys/errno.h > ${.TARGET}
 	./dumpdefs.py 2 0 i ${INCDIR}/sys/errno.h > ${.TARGET}
 	./dumpdefs.py 2 1 i ${INCDIR}/sys/errno.h >> ${.TARGET}
 	./dumpdefs.py 2 1 i ${INCDIR}/sys/errno.h >> ${.TARGET}
-	./dumpdefs.py 2 2 i ${INCDIR}/sys/errno.h >> ${.TARGET}
+	./dumpdefs.py 2 2 i ${INCDIR}/sys/errno.h | grep -v "= -" >> ${.TARGET}
 
 
 namemax:
 namemax:
 	grep "	NAME_MAX	" ${INCDIR}/sys/syslimits.h | head -1 | awk '{print $$3}' | tr -d '\n' > ${.TARGET}
 	grep "	NAME_MAX	" ${INCDIR}/sys/syslimits.h | head -1 | awk '{print $$3}' | tr -d '\n' > ${.TARGET}

+ 15 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/defs-clockid

@@ -0,0 +1,15 @@
+		(* FreeBSD 11.0 /usr/include/time.h *)
+			CLOCK_REALTIME* = 0;
+			CLOCK_VIRTUAL* = 1;
+			CLOCK_PROF* = 2;
+			CLOCK_MONOTONIC* = 4;
+			CLOCK_UPTIME* = 5; (* FreeBSD-specific *)
+			CLOCK_UPTIME_PRECISE* = 7; (* FreeBSD-specific *)
+			CLOCK_UPTIME_FAST* = 8; (* FreeBSD-specific *)
+			CLOCK_REALTIME_PRECISE* = 9; (* FreeBSD-specific *)
+			CLOCK_REALTIME_FAST* = 10; (* FreeBSD-specific *)
+			CLOCK_MONOTONIC_PRECISE* = 11; (* FreeBSD-specific *)
+			CLOCK_MONOTONIC_FAST* = 12; (* FreeBSD-specific *)
+			CLOCK_SECOND* = 13; (* FreeBSD-specific *)
+			CLOCK_THREAD_CPUTIME_ID* = 14;
+			CLOCK_PROCESS_CPUTIME_ID* = 15;

+ 3 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/fields-timespec

@@ -0,0 +1,3 @@
+			(* FreeBSD 11.0 /usr/include/sys/_timespec.h *)
+				tv_sec*: time_t; (* seconds *)
+				tv_nsec*: long; (* and nanoseconds *)

+ 1 - 1
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/osname

@@ -1 +1 @@
-FreeBSD 9.0
+FreeBSD 11.0

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/sizeofs.c

@@ -59,6 +59,7 @@ int main ()
 	D("ssize_t", sizeof(ssize_t), FALSE, TRUE);
 	D("ssize_t", sizeof(ssize_t), FALSE, TRUE);
 	D("off_t", sizeof(off_t), FALSE, TRUE);
 	D("off_t", sizeof(off_t), FALSE, TRUE);
 	D("clock_t", sizeof(clock_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("time_t", sizeof(time_t), FALSE, TRUE);
 	D("mode_t", sizeof(mode_t), TRUE, TRUE);
 	D("mode_t", sizeof(mode_t), TRUE, TRUE);
 	D("pid_t", sizeof(pid_t), FALSE, TRUE);
 	D("pid_t", sizeof(pid_t), FALSE, TRUE);

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py

@@ -15,6 +15,7 @@ def main ():
 
 
 #include <errno.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdio.h>
+#include <string.h>
 
 
 static void D (const char *s, int e)
 static void D (const char *s, int e)
 {
 {