summaryrefslogtreecommitdiffstats
path: root/Modules/_testexternalinspection.c
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2024-03-07 04:24:52 (GMT)
committerGitHub <noreply@github.com>2024-03-07 04:24:52 (GMT)
commitb33980a2e3f195c63e3aadeeebd8e50eb41ad70c (patch)
tree09e24a9917954a4517c7b1ed61e539bbd9a92056 /Modules/_testexternalinspection.c
parentbc708c76d2b3ad7bbfd6577a4444e1e47db60fd6 (diff)
downloadcpython-b33980a2e3f195c63e3aadeeebd8e50eb41ad70c.zip
cpython-b33980a2e3f195c63e3aadeeebd8e50eb41ad70c.tar.gz
cpython-b33980a2e3f195c63e3aadeeebd8e50eb41ad70c.tar.bz2
gh-114099 - Add iOS testbed, plus Makefile target to invoke it. (gh-115930)
Diffstat (limited to 'Modules/_testexternalinspection.c')
-rw-r--r--Modules/_testexternalinspection.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/_testexternalinspection.c b/Modules/_testexternalinspection.c
index 4929a7b..bd77f0c 100644
--- a/Modules/_testexternalinspection.c
+++ b/Modules/_testexternalinspection.c
@@ -15,7 +15,9 @@
# include <sys/mman.h>
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__)
+# include <TargetConditionals.h>
+# if TARGET_OS_OSX
# include <libproc.h>
# include <mach-o/fat.h>
# include <mach-o/loader.h>
@@ -26,6 +28,7 @@
# include <sys/mman.h>
# include <sys/proc.h>
# include <sys/sysctl.h>
+# endif
#endif
#include <errno.h>
@@ -50,7 +53,7 @@
# define HAVE_PROCESS_VM_READV 0
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__) && TARGET_OS_OSX
static void*
analyze_macho64(mach_port_t proc_ref, void* base, void* map)
{
@@ -373,7 +376,7 @@ read_memory(pid_t pid, void* remote_address, size_t len, void* dst)
result += read;
} while ((size_t)read != local[0].iov_len);
total_bytes_read = result;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && TARGET_OS_OSX
ssize_t result = -1;
kern_return_t kr = mach_vm_read_overwrite(
pid_to_task(pid),
@@ -429,7 +432,7 @@ get_py_runtime(pid_t pid)
{
#if defined(__linux__)
return get_py_runtime_linux(pid);
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && TARGET_OS_OSX
return get_py_runtime_macos(pid);
#else
return NULL;