Path: blob/main/core/sqlite/src/patches/00-syscall.patch
1067 views
diff --git a/src/os_unix.c b/src/os_unix.c1index b933de3..61490f2 1006442--- a/src/os_unix.c3+++ b/src/os_unix.c4@@ -549,6 +549,67 @@ static struct unix_syscall {56}; /* End of the overrideable system calls */78+// WebAssembly note: these overrideable system calls are not possible with9+// webassembly **with performance** since you'll just get the error10+// "null function or function signature mismatch" since WASM doesn't allow11+// incompatible signatures with functions. I think emscripten/pyodide gets12+// around this by proxying the call through Javascript, rather than using13+// a direct function pointer from the WASM function pointer table. However,14+// in my benchmarks, that can be a 100x performance penalty, so not a good option.15+// We don't need overrideable system calls anyways, so we just undo the above.16+17+#undef osOpen18+#define osOpen open19+#undef osClose20+#define osClose close21+#undef osAccess22+#define osAccess access23+#undef osGetcwd24+#define osGetcwd getcwd25+#undef osStat26+#define osStat stat27+#undef osFstat28+#define osFstat fstat29+#undef osFtruncate30+#define osFtruncate ftruncate31+#undef osFcntl32+#define osFcntl fcntl33+#undef osRead34+#define osRead read35+#undef osPread36+#define osPread pread37+#undef osPread6438+#define osPread64 pread6439+#undef osWrite40+#define osWrite write41+#undef osPwrite42+#define osPwrite pwrite43+#undef osPwrite6444+#define osPwrite64 pwrite6445+#undef osFchmod46+#define osFchmod fchmod47+#undef osFallocate48+#define osFallocate fallocate49+#undef osUnlink50+#define osUnlink unlink51+#undef osOpendirectory52+#define osOpendirectory openDirectory53+#undef osMkdir54+#define osMkdir mkdir55+#undef osRmdir56+#define osRmdir rmdir57+#undef osFchown58+#define osFchown fchown59+#undef osGeteuid60+#define osGeteuid geteuid61+#undef osReadlink62+#define osReadlink readlink63+#undef osLstat64+#define osLstat lstat65+#undef osIoctl66+#define osIoctl ioctl67+68+697071