aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2004-10-01 02:00:31 +0000
committerdrh <drh@noemail.net>2004-10-01 02:00:31 +0000
commiteb206256f1fac9b79fde3375f3670c5ecb52f11b (patch)
tree88fdcce79a1ac7d3c59620c4222e094397c6d20c /src/os_unix.c
parenta3f70cbc313f245c53696a08c1d27fdbcd41df97 (diff)
downloadsqlite-eb206256f1fac9b79fde3375f3670c5ecb52f11b.tar.gz
sqlite-eb206256f1fac9b79fde3375f3670c5ecb52f11b.zip
Use type i64 instead of off_t for file offsets since off_t is giving
portability problems. Ticket #924. (CVS 1992) FossilOrigin-Name: 8972c004dc825f668d952e7d082a89046b9260f1
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 003f039be..aab518f47 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -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);