mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-08 10:50:28 +00:00
Update SQLite to use pread()/pwrite() (reapply 98909b13
)
This commit is contained in:
parent
95595c1d5a
commit
5e90ac3dd4
1 changed files with 3 additions and 14 deletions
17
third_party/sqlite3/os_unix.c
vendored
17
third_party/sqlite3/os_unix.c
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
// clang-format off
|
||||||
/*
|
/*
|
||||||
** 2004 May 22
|
** 2004 May 22
|
||||||
**
|
**
|
||||||
|
@ -44,9 +45,9 @@
|
||||||
** plus implementations of sqlite3_os_init() and sqlite3_os_end().
|
** plus implementations of sqlite3_os_init() and sqlite3_os_end().
|
||||||
*/
|
*/
|
||||||
#include "libc/stdio/rand.h"
|
#include "libc/stdio/rand.h"
|
||||||
|
#include "libc/sysv/consts/lock.h"
|
||||||
#include "third_party/sqlite3/sqliteInt.h"
|
#include "third_party/sqlite3/sqliteInt.h"
|
||||||
#if SQLITE_OS_UNIX /* This file is used on unix only */
|
#if SQLITE_OS_UNIX /* This file is used on unix only */
|
||||||
/* clang-format off */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** There are various methods for file locking used for concurrency
|
** There are various methods for file locking used for concurrency
|
||||||
|
@ -74,7 +75,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Use pread() and pwrite() if they are available */
|
/* Use pread() and pwrite() if they are available */
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__) || defined(__COSMOPOLITAN__) /* [jart] */
|
||||||
# define HAVE_PREAD 1
|
# define HAVE_PREAD 1
|
||||||
# define HAVE_PWRITE 1
|
# define HAVE_PWRITE 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -152,10 +153,6 @@
|
||||||
# include "libc/limits.h"
|
# include "libc/limits.h"
|
||||||
#endif /* OS_VXWORKS */
|
#endif /* OS_VXWORKS */
|
||||||
|
|
||||||
#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
|
|
||||||
# include <sys/mount.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_UTIME
|
#ifdef HAVE_UTIME
|
||||||
# include "libc/time/time.h"
|
# include "libc/time/time.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -343,14 +340,6 @@ static pid_t randomnessPid = 0;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
** Explicitly call the 64-bit version of lseek() on Android. Otherwise, lseek()
|
|
||||||
** is the 32-bit version, even if _FILE_OFFSET_BITS=64 is defined.
|
|
||||||
*/
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
# define lseek lseek64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
/*
|
/*
|
||||||
** Linux-specific IOCTL magic numbers used for controlling F2FS
|
** Linux-specific IOCTL magic numbers used for controlling F2FS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue