mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Add the SQLITE_TESTCTRL_PRNG_SEED test control.
FossilOrigin-Name: 3ac5723164ae801e209ce525a5d94692767136f9d06be2a84883dcea677d02da
This commit is contained in:
10
src/os.c
10
src/os.c
@@ -258,7 +258,15 @@ void sqlite3OsDlClose(sqlite3_vfs *pVfs, void *pHandle){
|
||||
}
|
||||
#endif /* SQLITE_OMIT_LOAD_EXTENSION */
|
||||
int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
|
||||
return pVfs->xRandomness(pVfs, nByte, zBufOut);
|
||||
if( sqlite3Config.iPrngSeed ){
|
||||
memset(zBufOut, 0, nByte);
|
||||
if( nByte>sizeof(unsigned) ) nByte = sizeof(unsigned int);
|
||||
memcpy(zBufOut, &sqlite3Config.iPrngSeed, nByte);
|
||||
return SQLITE_OK;
|
||||
}else{
|
||||
return pVfs->xRandomness(pVfs, nByte, zBufOut);
|
||||
}
|
||||
|
||||
}
|
||||
int sqlite3OsSleep(sqlite3_vfs *pVfs, int nMicro){
|
||||
return pVfs->xSleep(pVfs, nMicro);
|
||||
|
Reference in New Issue
Block a user