Some old linux versions do not have process_vm_readv function defined. Even older versions do not
have even the __NR_process_vm_readv syscall number. We use cmake to detect these situations and
fallback appropriately: in the first case, we can issue the syscall manually, while it the latter
case, we need to drop fast memory read support completely.
Details
Diff Detail
Event Timeline
Please define -DHAVE_PROCESS_VM_READV and -DHAVE_NR_PROCESS_VM_READV without values and check them with #ifdef/#ifndef.
I had preprocessor errors with #if ! applied to undefined variable in Uio.h and LibcGlue.cpp.
Build was successful after I changed #if ! to #ifdef.
Just dug in more and this is what I have in DependInfo.cmake files:
"HAVE_NR_PROCESS_VM_READV=1" "HAVE_PROCESS_VM_READV="
HAVE_PROCESS_VM_READV is defined without value. However, value is completely irrelevant, fact of variable definition should be enough .
source/Host/linux/LibcGlue.cpp also need to include #include <unistd.h> (for syscall() prototype). Sorry, I didn't catch it yesterday because I incorrectly applied ifndef.
Man page tells to define #define _GNU_SOURCE before #include <unistd.h>.
I'm not sure, but probably macro should start from HAS, not HAVE, since they are about operation system.
source/Host/linux/LibcGlue.cpp also need to include #include <unistd.h> (for syscall() prototype). Sorry, I didn't catch it yesterday because I incorrectly applied ifndef.
I've added unistd.h and committed. Let me know if you see any problems.
Man page tells to define #define _GNU_SOURCE before #include <unistd.h>.
This macro is defined (for me at least) on the compiler command line. If this is not the case for you, then we can work it out separately.
I'm not sure, but probably macro should start from HAS, not HAVE, since they are about operation system.
I am testing a feature of the c library (the support in the actual running kernel will be tested at runtime - we need this that way), which seems consistent with all the other HAVE_ macros i've seen.
Do we need to cast from ssize_t to int?