Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allowed _remote_debugging to build on more OS versions by using proc_listpids() rather than proc_listallpids().
5 changes: 3 additions & 2 deletions Modules/_remote_debugging/subprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ get_child_pids_platform(pid_t target_pid, int recursive, pid_array_t *result)

#if defined(__APPLE__) && TARGET_OS_OSX

#include <libproc.h>
#include <sys/proc_info.h>

static int
Expand All @@ -283,7 +284,7 @@ get_child_pids_platform(pid_t target_pid, int recursive, pid_array_t *result)
pid_t *ppids = NULL;

/* Get count of all PIDs */
int n_pids = proc_listallpids(NULL, 0);
int n_pids = proc_listpids(PROC_ALL_PIDS, 0, NULL, 0);
if (n_pids <= 0) {
PyErr_SetString(PyExc_OSError, "Failed to get process count");
goto done;
Expand All @@ -298,7 +299,7 @@ get_child_pids_platform(pid_t target_pid, int recursive, pid_array_t *result)
}

/* Get actual PIDs */
int actual = proc_listallpids(pid_list, buffer_size * sizeof(pid_t));
int actual = proc_listpids(PROC_ALL_PIDS, 0, pid_list, buffer_size * sizeof(pid_t));
if (actual <= 0) {
PyErr_SetString(PyExc_OSError, "Failed to list PIDs");
goto done;
Expand Down
Loading