diff options
author | drh <drh@noemail.net> | 2016-01-12 00:37:55 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-01-12 00:37:55 +0000 |
commit | e2258a2076c237a70d4dbec7be3754fceebc2f1d (patch) | |
tree | 0b95d8e0b4a966d078076e97d2d183b59ebebedc /src | |
parent | 00dcecab193d4b9c008caa50ccb10f479a5aae96 (diff) | |
download | sqlite-e2258a2076c237a70d4dbec7be3754fceebc2f1d.tar.gz sqlite-e2258a2076c237a70d4dbec7be3754fceebc2f1d.zip |
Various #ifdef enhancements for improved VxWorks support.
FossilOrigin-Name: 75cd41ff179e29c5d45f9d7fed784bc339e0d7a0
Diffstat (limited to 'src')
-rw-r--r-- | src/os_unix.c | 16 | ||||
-rw-r--r-- | src/vxworks.h | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index a40a86678..5bd611694 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -430,7 +430,11 @@ static struct unix_syscall { { "rmdir", (sqlite3_syscall_ptr)rmdir, 0 }, #define osRmdir ((int(*)(const char*))aSyscall[19].pCurrent) +#if defined(HAVE_FCHOWN) { "fchown", (sqlite3_syscall_ptr)fchown, 0 }, +#else + { "fchown", (sqlite3_syscall_ptr)0, 0 }, +#endif #define osFchown ((int(*)(int,uid_t,gid_t))aSyscall[20].pCurrent) { "geteuid", (sqlite3_syscall_ptr)geteuid, 0 }, @@ -464,7 +468,11 @@ static struct unix_syscall { #endif #define osGetpagesize ((int(*)(void))aSyscall[25].pCurrent) +#if defined(HAVE_READLINK) { "readlink", (sqlite3_syscall_ptr)readlink, 0 }, +#else + { "readlink", (sqlite3_syscall_ptr)0, 0 }, +#endif #define osReadlink ((ssize_t(*)(const char*,char*,size_t))aSyscall[26].pCurrent) @@ -477,10 +485,10 @@ static struct unix_syscall { ** we are not running as root. */ static int robustFchown(int fd, uid_t uid, gid_t gid){ -#if OS_VXWORKS - return 0; -#else +#if defined(HAVE_FCHOWN) return osGeteuid() ? 0 : osFchown(fd,uid,gid); +#else + return 0; #endif } @@ -5947,6 +5955,7 @@ static int unixFullPathname( assert( pVfs->mxPathname==MAX_PATHNAME ); UNUSED_PARAMETER(pVfs); +#if defined(HAVE_READLINK) /* Attempt to resolve the path as if it were a symbolic link. If it is ** a symbolic link, the resolved path is stored in buffer zOut[]. Or, if ** the identified file is not a symbolic link or does not exist, then @@ -5962,6 +5971,7 @@ static int unixFullPathname( }else{ zOut[nByte] = '\0'; } +#endif /* If buffer zOut[] now contains an absolute path there is nothing more ** to do. If it contains a relative path, do the following: diff --git a/src/vxworks.h b/src/vxworks.h index 45a44453a..60c41a19b 100644 --- a/src/vxworks.h +++ b/src/vxworks.h @@ -26,4 +26,6 @@ #else /* This is not VxWorks. */ #define OS_VXWORKS 0 +#define HAVE_FCHOWN 1 +#define HAVE_READLINK 1 #endif /* defined(_WRS_KERNEL) */ |