mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-27 08:52:26 +03:00
Use type i64 instead of off_t for file offsets since off_t is giving
portability problems. Ticket #924. (CVS 1992) FossilOrigin-Name: 8972c004dc825f668d952e7d082a89046b9260f1
This commit is contained in:
@@ -12,9 +12,9 @@
|
||||
**
|
||||
** This file contains code that is specific to Unix systems.
|
||||
*/
|
||||
#include "os.h" /* Must be first to enable large file support */
|
||||
#if OS_UNIX /* This file is used on unix only */
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
#if OS_UNIX /* This file is used on unix only */
|
||||
|
||||
|
||||
#include <time.h>
|
||||
@@ -34,6 +34,7 @@
|
||||
# define O_BINARY 0
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** The DJGPP compiler environment looks mostly like Unix, but it
|
||||
** lacks the fcntl() system call. So redefine fcntl() to be something
|
||||
@@ -662,7 +663,7 @@ int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
|
||||
/*
|
||||
** Move the read/write pointer in a file.
|
||||
*/
|
||||
int sqlite3OsSeek(OsFile *id, off_t offset){
|
||||
int sqlite3OsSeek(OsFile *id, i64 offset){
|
||||
assert( id->isOpen );
|
||||
SEEK(offset/1024 + 1);
|
||||
lseek(id->h, offset, SEEK_SET);
|
||||
@@ -733,7 +734,7 @@ int sqlite3OsSyncDirectory(const char *zDirname){
|
||||
/*
|
||||
** Truncate an open file to a specified size
|
||||
*/
|
||||
int sqlite3OsTruncate(OsFile *id, off_t nByte){
|
||||
int sqlite3OsTruncate(OsFile *id, i64 nByte){
|
||||
assert( id->isOpen );
|
||||
SimulateIOError(SQLITE_IOERR);
|
||||
return ftruncate(id->h, nByte)==0 ? SQLITE_OK : SQLITE_IOERR;
|
||||
@@ -742,7 +743,7 @@ int sqlite3OsTruncate(OsFile *id, off_t nByte){
|
||||
/*
|
||||
** Determine the current size of a file in bytes
|
||||
*/
|
||||
int sqlite3OsFileSize(OsFile *id, off_t *pSize){
|
||||
int sqlite3OsFileSize(OsFile *id, i64 *pSize){
|
||||
struct stat buf;
|
||||
assert( id->isOpen );
|
||||
SimulateIOError(SQLITE_IOERR);
|
||||
|
||||
Reference in New Issue
Block a user