From: John B. <bel...@us...> - 2001-10-29 19:45:34
|
Build Number:538 Update of /cvsroot/firebird/interbase/utilities In directory usw-pr-cvs1:/tmp/cvs-serv10637/utilities Modified Files: sbc_print.c rebuild.c dba_full.e dba.e analyse.c Log Message: Added 64 bit io code for *nix. Requires the macro UNIX_64_BIT_IO to be defined, or else you get a 32 bit version. Since all supported Darwin platforms support 64 bit it the macro is always defined on Darwin. No other platforms have the macro defined by default. unix.c now performs a runtime check on the 32 bit builds to make sure they don't exceed a 2 GB file size. Note that this doesn't effect the PREAD_WRITE code. Platforms that use PREAD_WRITE are can't use the 64 bit io stuff. Looking through the platform files and common.h revealed not platforms use PREAD_WRITE. So this limitation is not a problem. Index: sbc_print.c =================================================================== RCS file: /cvsroot/firebird/interbase/utilities/sbc_print.c,v retrieving revision 1.2 retrieving revision 1.3 diff -U3 -r1.2 -r1.3 --- sbc_print.c 2001/04/05 17:05:43 1.2 +++ sbc_print.c 2001/10/29 19:45:30 1.3 @@ -20,13 +20,13 @@ * All Rights Reserved. * Contributor(s): ______________________________________. */ +#include "../jrd/common.h" #include "../jrd/ib_stdio.h" #include <string.h> #include <fcntl.h> #include <errno.h> #include <stdlib.h> -#include "../jrd/common.h" typedef struct blk { UCHAR blk_type; @@ -877,8 +877,10 @@ **************************************/ SCHAR *p; SSHORT length, l; +UINT64 offset; -if (lseek (file, page_number * page_size, 0) == -1) +offset = ((UINT64)page_number) * ((UINT64)page_size); +if (lseek (file, offset, 0) == -1) db_error (errno); for (p = (SCHAR*) global_buffer, length = page_size; length > 0;) Index: rebuild.c =================================================================== RCS file: /cvsroot/firebird/interbase/utilities/rebuild.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -U3 -r1.1.1.1 -r1.2 --- rebuild.c 2000/08/03 20:54:28 1.1.1.1 +++ rebuild.c 2001/10/29 19:45:30 1.2 @@ -20,6 +20,7 @@ * All Rights Reserved. * Contributor(s): ______________________________________. */ +#include "../jrd/common.h" #include "../jrd/ib_stdio.h" #include <errno.h> @@ -679,10 +680,12 @@ SCHAR *p; SSHORT length, l; int file; +UINT64 offset; file = rbdb->rbdb_file.fil_file; -if (lseek (file, page_number * rbdb->rbdb_page_size, 0) == -1) +offset = ((UINT64)page_number) * ((UINT64)rbdb->rbdb_page_size); +if (lseek (file, offset, 0) == -1) db_error (errno); for (p = (SCHAR*) rbdb->rbdb_buffer1, length = rbdb->rbdb_page_size; length > 0;) @@ -716,12 +719,14 @@ **************************************/ ULONG page_size; int fd; +UINT64 offset; page->pag_checksum = compute_checksum (rbdb, page); page_size = rbdb->rbdb_page_size; fd = rbdb->rbdb_file.fil_file; -if (lseek (fd, page_number * page_size, 0) == -1) +offset = ((UINT64)page_number) * ((UINT64)page_size); +if (lseek (fd, offset, 0) == -1) db_error (errno); if (write (fd, page, page_size) == -1) db_error (errno); Index: dba_full.e =================================================================== RCS file: /cvsroot/firebird/interbase/utilities/dba_full.e,v retrieving revision 1.2 retrieving revision 1.3 diff -U3 -r1.2 -r1.3 --- dba_full.e 2001/04/05 17:05:43 1.2 +++ dba_full.e 2001/10/29 19:45:30 1.3 @@ -20,12 +20,12 @@ * All Rights Reserved. * Contributor(s): ______________________________________. */ +#include "../jrd/common.h" #include "../jrd/ib_stdio.h" #include <errno.h> #include <string.h> #include "../jrd/ibsetjmp.h" -#include "../jrd/common.h" #include "../jrd/time.h" #include "../jrd/gds.h" #include "../jrd/ods.h" @@ -1256,6 +1256,7 @@ SSHORT length, l; FIL fil; TDBA tddba; +UINT64 offset; tddba = GET_THREAD_DATA; @@ -1263,7 +1264,8 @@ fil = fil->fil_next; page_number -= fil->fil_min_page - fil->fil_fudge; -if (lseek (fil->fil_desc, page_number * tddba->page_size, 0) == -1) +offset = ((UINT64)page_number) * ((UINT64)tddba->page_size); +if (lseek (fil->fil_desc, offset, 0) == -1) db_error (errno); for (p = (SCHAR*) tddba->global_buffer, length = tddba->page_size; length > 0;) @@ -1899,6 +1901,7 @@ SSHORT length, l; FIL fil; TDBA tddba; +UINT64 offset; tddba = GET_THREAD_DATA; @@ -1906,7 +1909,8 @@ fil = fil->fil_next; page_number -= fil->fil_min_page - fil->fil_fudge; -if (lseek (fil->fil_desc, page_number * tddba->page_size, 0) == -1) +offset = ((UINT64)page_number) * ((UINT64)tddba->page_size); +if (lseek (fil->fil_desc, offset, 0) == -1) db_error (errno); for (p = (SCHAR*) tddba->global_buffer, length = tddba->page_size; length > 0;) Index: dba.e =================================================================== RCS file: /cvsroot/firebird/interbase/utilities/dba.e,v retrieving revision 1.9 retrieving revision 1.10 diff -U3 -r1.9 -r1.10 --- dba.e 2001/08/08 22:22:22 1.9 +++ dba.e 2001/10/29 19:45:30 1.10 @@ -24,13 +24,13 @@ * conditionals, as the engine now fully supports * readonly databases. */ +#include "../jrd/common.h" #include "../jrd/ib_stdio.h" #include <errno.h> #include <string.h> #include <fcntl.h> #include "../jrd/ibsetjmp.h" -#include "../jrd/common.h" #include "../jrd/time.h" #include "../jrd/gds.h" #include "../jrd/ods.h" @@ -1466,6 +1466,7 @@ SSHORT length, l; DBA_FIL fil; TDBA tddba; +UINT64 offset; tddba = GET_THREAD_DATA; @@ -1478,7 +1479,8 @@ fil = fil->fil_next; page_number -= fil->fil_min_page - fil->fil_fudge; -if (lseek (fil->fil_desc, page_number * tddba->page_size, 0) == -1) +offset = ((UINT64)page_number) * ((UINT64)tddba->page_size); +if (lseek (fil->fil_desc, offset, 0) == -1) { #ifdef SUPERSERVER CMD_UTIL_put_svc_status (tddba->dba_service_blk->svc_status, @@ -2300,6 +2302,7 @@ SSHORT length, l; DBA_FIL fil; TDBA tddba; +UINT64 offset; tddba = GET_THREAD_DATA; @@ -2312,7 +2315,8 @@ fil = fil->fil_next; page_number -= fil->fil_min_page - fil->fil_fudge; -if (lseek (fil->fil_desc, page_number * tddba->page_size, 0) == -1) +offset = ((UINT64)page_number) * ((UINT64)tddba->page_size); +if (lseek (fil->fil_desc, offset, 0) == -1) { #ifdef SUPERSERVER CMD_UTIL_put_svc_status (tddba->dba_service_blk->svc_status, Index: analyse.c =================================================================== RCS file: /cvsroot/firebird/interbase/utilities/analyse.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -U3 -r1.1.1.1 -r1.2 --- analyse.c 2000/08/03 20:54:23 1.1.1.1 +++ analyse.c 2001/10/29 19:45:30 1.2 @@ -21,6 +21,8 @@ * Contributor(s): ______________________________________. */ +#include "../jrd/common.h" + #ifdef VMS #include <types.h> #include "times.h" @@ -30,7 +32,6 @@ #include <sys/time.h> #endif -#include "../jrd/common.h" #include "../jrd/ib_stdio.h" #include <errno.h> #include "jrd.h" @@ -423,11 +424,12 @@ * Read a database page. * **************************************/ + UINT64 offset = ((UINT64)page_number) * ((UINT64)page_size); if (!global_buffer) global_buffer = malloc (page_size); -if (lseek (file, page_number * page_size, 0) == -1) +if (lseek (file, offset, 0) == -1) db_error (errno); if (read (file, global_buffer, page_size) == -1) |