Alexander Shiryaev 7 tahun lalu
induk
melakukan
12fa9dc854

+ 0 - 1
BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ

@@ -225,7 +225,6 @@ MODULE LinLibc ["libc.so%%libver%%"];
 		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] close* (d: int): int;
-		PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
 
 	(* POSIX.1 *)
 		PROCEDURE [ccall] chmod* (path: PtrSTR; mode: mode_t): int;

+ 29 - 3
BlackBox/_Linux_/Lin/Mod/Libc.txt

@@ -516,6 +516,30 @@ MODULE LinLibc ["libc.so.6"];
 			_STAT_VER_LINUX* = 3;
 
 	TYPE
+		off64_t* = LONGINT;
+		blkcnt64_t* = LONGINT;
+		ino64_t* = LONGINT;
+
+		(* Ubuntu 18.04 /usr/include/i386-linux-gnu/bits/stat.h: *)
+			stat64_t* = RECORD [untagged]
+				st_dev*: dev_t;
+				__pad1: int; (* unsigned int *)
+				__st_ino: ino_t;
+				st_mode*: mode_t;
+				st_nlink*: nlink_t;
+				st_uid*: uid_t;
+				st_gid*: gid_t;
+				st_rdev*: dev_t;
+				__pad2: int; (* unsigned int *)
+				st_size*: off64_t;
+				st_blksize*: blksize_t;
+				st_blocks*: blkcnt64_t;
+				st_atim*: timespec_t;
+				st_mtim*: timespec_t;
+				st_ctim*: timespec_t;
+				st_ino*: ino64_t;
+			END;
+
 		(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/sigval_t.h: *)
 			sigval_t* = RECORD [union]
 				sival_int*: int;
@@ -548,9 +572,12 @@ MODULE LinLibc ["libc.so.6"];
 		stdin*, stdout*, stderr* : PtrFILE;
 *)
 
-	PROCEDURE [ccall] __errno_location*(): INTEGER;
+	PROCEDURE [ccall] __errno_location*(): PtrVoid;
+
+	PROCEDURE [ccall] __xstat* (version: int; filename: PtrSTR; VAR buf: stat_t): int;
+	PROCEDURE [ccall] __xstat64* (version: int; filename: PtrSTR; VAR buf: stat64_t): int;
 
-	PROCEDURE [ccall] __xstat* (version: INTEGER; filename: PtrSTR; VAR buf: stat_t): INTEGER;
+	PROCEDURE [ccall] lseek64* (fd: int; offset: off64_t; whence: int): off64_t;
 
 	PROCEDURE [ccall] sigsetjmp* ["__sigsetjmp"] (VAR env: sigjmp_buf; savemask: int): int;
 
@@ -639,7 +666,6 @@ MODULE LinLibc ["libc.so.6"];
 		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] close* (d: int): int;
-		PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
 
 	(* POSIX.1 *)
 		PROCEDURE [ccall] chmod* (path: PtrSTR; mode: mode_t): int;

+ 29 - 2
BlackBox/_Linux_/Lin/Mod/gen-Libc/custom

@@ -3,6 +3,30 @@
 			_STAT_VER_LINUX* = 3;
 
 	TYPE
+		off64_t* = LONGINT;
+		blkcnt64_t* = LONGINT;
+		ino64_t* = LONGINT;
+
+		(* Ubuntu 18.04 /usr/include/i386-linux-gnu/bits/stat.h: *)
+			stat64_t* = RECORD [untagged]
+				st_dev*: dev_t;
+				__pad1: int; (* unsigned int *)
+				__st_ino: ino_t;
+				st_mode*: mode_t;
+				st_nlink*: nlink_t;
+				st_uid*: uid_t;
+				st_gid*: gid_t;
+				st_rdev*: dev_t;
+				__pad2: int; (* unsigned int *)
+				st_size*: off64_t;
+				st_blksize*: blksize_t;
+				st_blocks*: blkcnt64_t;
+				st_atim*: timespec_t;
+				st_mtim*: timespec_t;
+				st_ctim*: timespec_t;
+				st_ino*: ino64_t;
+			END;
+
 		(* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/sigval_t.h: *)
 			sigval_t* = RECORD [union]
 				sival_int*: int;
@@ -35,8 +59,11 @@
 		stdin*, stdout*, stderr* : PtrFILE;
 *)
 
-	PROCEDURE [ccall] __errno_location*(): INTEGER;
+	PROCEDURE [ccall] __errno_location*(): PtrVoid;
+
+	PROCEDURE [ccall] __xstat* (version: int; filename: PtrSTR; VAR buf: stat_t): int;
+	PROCEDURE [ccall] __xstat64* (version: int; filename: PtrSTR; VAR buf: stat64_t): int;
 
-	PROCEDURE [ccall] __xstat* (version: INTEGER; filename: PtrSTR; VAR buf: stat_t): INTEGER;
+	PROCEDURE [ccall] lseek64* (fd: int; offset: off64_t; whence: int): off64_t;
 
 	PROCEDURE [ccall] sigsetjmp* ["__sigsetjmp"] (VAR env: sigjmp_buf; savemask: int): int;

+ 2 - 1
BlackBox/_OpenBSD_/Lin/Mod/Libc.txt

@@ -618,6 +618,8 @@ MODULE LinLibc ["libc.so.90"];
 	(* POSIX.1 *)
 		PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
 
+		PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
+
 	(* POSIX.1 *)
 		PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
 
@@ -706,7 +708,6 @@ MODULE LinLibc ["libc.so.90"];
 		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] close* (d: int): int;
-		PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
 
 	(* POSIX.1 *)
 		PROCEDURE [ccall] chmod* (path: PtrSTR; mode: mode_t): int;

+ 2 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/custom

@@ -14,5 +14,7 @@
 	(* POSIX.1 *)
 		PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
 
+		PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
+
 	(* POSIX.1 *)
 		PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;