1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-16 15:02:33 +03:00

Enable large file support.

Use off_t and size_t in pg_dump to handle file offset arithmetic correctly.
This commit is contained in:
Peter Eisentraut
2002-08-20 17:54:45 +00:00
parent 0d6f613817
commit 6faf8024fa
14 changed files with 722 additions and 245 deletions

View File

@@ -17,16 +17,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.9 2002/05/10 22:36:26 tgl Exp $
*
* Modifications - 09-Jul-2000 - pjw@rhyme.com.au
*
* Initial version.
*
* Modifications - 04-Jan-2001 - pjw@rhyme.com.au
*
* - Check results of IO routines more carefully.
*
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.10 2002/08/20 17:54:44 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -38,10 +29,10 @@
#include <string.h>
#include <unistd.h> /* for dup */
static int _WriteData(ArchiveHandle *AH, const void *data, int dLen);
static size_t _WriteData(ArchiveHandle *AH, const void *data, size_t dLen);
static void _EndData(ArchiveHandle *AH, TocEntry *te);
static int _WriteByte(ArchiveHandle *AH, const int i);
static int _WriteBuf(ArchiveHandle *AH, const void *buf, int len);
static size_t _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len);
static void _CloseArchive(ArchiveHandle *AH);
static void _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt);
@@ -75,8 +66,8 @@ InitArchiveFmt_Null(ArchiveHandle *AH)
* As at V1.3, this is only called for COPY FROM dfata, and BLOB data
*------
*/
static int
_WriteData(ArchiveHandle *AH, const void *data, int dLen)
static size_t
_WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
{
/* Just send it to output */
ahwrite(data, 1, dLen, AH);
@@ -112,8 +103,8 @@ _WriteByte(ArchiveHandle *AH, const int i)
return 0;
}
static int
_WriteBuf(ArchiveHandle *AH, const void *buf, int len)
static size_t
_WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
{
/* Don't do anything */
return len;