blob: 3fb67e388767291dc066327d49daf83c19435cf2 [file] [log] [blame]
diff --git a/shell.c b/shell.c
--- a/shell.c
+++ b/shell.c
@@ -2952,6 +2968,10 @@ int main(int argc, char **argv){
main_init(&data);
stdin_is_interactive = isatty(0);
+#if defined __native_client__ && !defined PPAPI
+ stdin_is_interactive = 1;
+#endif
+
/* Make sure we have a valid signal handler early, before anything
** else is done.
*/
diff --git a/sqlite3.c b/sqlite3.c
--- a/sqlite3.c
+++ b/sqlite3.c
@@ -22852,6 +22852,27 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
#include <sys/mman.h>
#endif
+/* flock struct was added to PNaCl toolchain in 32 and
+ * newlib toolchain in 33
+ * TODO(sbc): remove this once 33 goes stable */
+#if defined __native_client__ && !defined __GLIBC__
+ #if defined __PNACL__ && NACL_SDK_VERSION < 32
+ #define MISSING_FLOCK
+ #elif !defined __PNACL__ && NACL_SDK_VERSION < 33
+ #define MISSING_FLOCK
+ #endif
+#endif
+
+#ifdef MISSING_FLOCK
+struct flock {
+ short l_type;
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+};
+#endif
+
#if SQLITE_ENABLE_LOCKING_STYLE
# include <sys/ioctl.h>
@@ -29891,6 +29912,11 @@ SQLITE_API int sqlite3_os_init(void){
** array cannot be const.
*/
static sqlite3_vfs aVfs[] = {
+#if defined __native_client__
+ // Give higher priority to "unix-dotfile" over "unix", because NaCl doesn't
+ // support some POSIX fcntl operations (F_GETLK, F_SETLK).
+ UNIXVFS("unix-dotfile", dotlockIoFinder ),
+#endif
#if SQLITE_ENABLE_LOCKING_STYLE && (OS_VXWORKS || defined(__APPLE__))
UNIXVFS("unix", autolockIoFinder ),
#else