Skip to content

Commit ddf73f6

Browse files
committed
comso_dlopen for loadable SQLite extensions
1 parent d1aed34 commit ddf73f6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

llama.cpp/embedfile/sqlite3.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45225,7 +45225,8 @@ static int unixFullPathname(
4522545225
#include <dlfcn.h>
4522645226
static void *unixDlOpen(sqlite3_vfs *NotUsed, const char *zFilename){
4522745227
UNUSED_PARAMETER(NotUsed);
45228-
return dlopen(zFilename, RTLD_NOW | RTLD_GLOBAL);
45228+
// asg017
45229+
return cosmo_dlopen(zFilename, RTLD_NOW | RTLD_GLOBAL);
4522945230
}
4523045231

4523145232
/*
@@ -45239,7 +45240,8 @@ static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut){
4523945240
const char *zErr;
4524045241
UNUSED_PARAMETER(NotUsed);
4524145242
unixEnterMutex();
45242-
zErr = dlerror();
45243+
// asg017
45244+
zErr = cosmo_dlerror();
4524345245
if( zErr ){
4524445246
sqlite3_snprintf(nBuf, zBufOut, "%s", zErr);
4524545247
}
@@ -45265,12 +45267,14 @@ static void (*unixDlSym(sqlite3_vfs *NotUsed, void *p, const char*zSym))(void){
4526545267
*/
4526645268
void (*(*x)(void*,const char*))(void);
4526745269
UNUSED_PARAMETER(NotUsed);
45268-
x = (void(*(*)(void*,const char*))(void))dlsym;
45270+
// asg017
45271+
x = (void(*(*)(void*,const char*))(void))cosmo_dlsym;
4526945272
return (*x)(p, zSym);
4527045273
}
4527145274
static void unixDlClose(sqlite3_vfs *NotUsed, void *pHandle){
4527245275
UNUSED_PARAMETER(NotUsed);
45273-
dlclose(pHandle);
45276+
// asg017
45277+
cosmo_dlclose(pHandle);
4527445278
}
4527545279
#else /* if SQLITE_OMIT_LOAD_EXTENSION is defined: */
4527645280
#define unixDlOpen 0

0 commit comments

Comments
 (0)