/ Check-in [177cd929]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In os_unix.c, make a distinction between pread() and pread64(). Add a new compile-time macro USE_PREAD64 to select the latter. (CVS 3709)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:177cd92910d01c97eb3133a59fad417edbb1aa92
User & Date: drh 2007-03-22 15:22:06
Context
2007-03-23
10:08
Add a comment to the OsSectorSize() function. (CVS 3710) check-in: 0fd9983a user: danielk1977 tags: trunk
2007-03-22
15:22
In os_unix.c, make a distinction between pread() and pread64(). Add a new compile-time macro USE_PREAD64 to select the latter. (CVS 3709) check-in: 177cd929 user: drh tags: trunk
15:20
Call sqlite3_free() instead of free() to release a buffer allocated by sqlite3_vmprintf() in test_async.c (test suite bug only). (CVS 3708) check-in: b078f09b user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

   998    998   ** Seek to the offset in id->offset then read cnt bytes into pBuf.
   999    999   ** Return the number of bytes actually read.  Update the offset.
  1000   1000   */
  1001   1001   static int seekAndRead(unixFile *id, void *pBuf, int cnt){
  1002   1002     int got;
  1003   1003     i64 newOffset;
  1004   1004     TIMER_START;
  1005         -#ifdef USE_PREAD
         1005  +#if defined(USE_PREAD)
  1006   1006     got = pread(id->h, pBuf, cnt, id->offset);
         1007  +#elif defined(USE_PREAD64)
         1008  +  got = pread64(id->h, pBuf, cnt, id->offset);
  1007   1009   #else
  1008   1010     newOffset = lseek(id->h, id->offset, SEEK_SET);
  1009   1011     if( newOffset!=id->offset ){
  1010   1012       return -1;
  1011   1013     }
  1012   1014     got = read(id->h, pBuf, cnt);
  1013   1015   #endif
................................................................................
  1043   1045   ** Seek to the offset in id->offset then read cnt bytes into pBuf.
  1044   1046   ** Return the number of bytes actually read.  Update the offset.
  1045   1047   */
  1046   1048   static int seekAndWrite(unixFile *id, const void *pBuf, int cnt){
  1047   1049     int got;
  1048   1050     i64 newOffset;
  1049   1051     TIMER_START;
  1050         -#ifdef USE_PREAD
         1052  +#if defined(USE_PREAD)
  1051   1053     got = pwrite(id->h, pBuf, cnt, id->offset);
         1054  +#elif defined(USE_PREAD64)
         1055  +  got = pwrite64(id->h, pBuf, cnt, id->offset);
  1052   1056   #else
  1053   1057     newOffset = lseek(id->h, id->offset, SEEK_SET);
  1054   1058     if( newOffset!=id->offset ){
  1055   1059       return -1;
  1056   1060     }
  1057   1061     got = write(id->h, pBuf, cnt);
  1058   1062   #endif