--- a/src/os_unix.c +++ b/src/os_unix.c @@ -64,7 +64,7 @@ ** where the database is located. */ #if !defined(SQLITE_ENABLE_LOCKING_STYLE) -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__GNU__) # define SQLITE_ENABLE_LOCKING_STYLE 1 # else # define SQLITE_ENABLE_LOCKING_STYLE 0 @@ -131,7 +131,7 @@ # endif #endif /* SQLITE_ENABLE_LOCKING_STYLE */ -#if defined(__APPLE__) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS) +#if (defined(__APPLE__) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)) && ! defined(__GNU__) # include #endif @@ -4180,7 +4180,7 @@ noLock = eType!=SQLITE_OPEN_MAIN_DB; -#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE +#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE struct statfs fsInfo; if( fstatfs(fd, &fsInfo) == -1 ){ ((unixFile*)pFile)->lastErrno = errno; @@ -4193,7 +4193,7 @@ } #endif -#if SQLITE_ENABLE_LOCKING_STYLE +#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE #if SQLITE_PREFER_PROXY_LOCKING isAutoProxy = 1; #endif @@ -5785,6 +5785,8 @@ static sqlite3_vfs aVfs[] = { #if SQLITE_ENABLE_LOCKING_STYLE && (OS_VXWORKS || defined(__APPLE__)) UNIXVFS("unix", autolockIoFinder ), +#elif SQLITE_ENABLE_LOCKING_STYLE && defined(__GNU__) + UNIXVFS("unix", flockIoFinder ), #else UNIXVFS("unix", posixIoFinder ), #endif