Commit 1518fb17 authored by Yoni Fogel's avatar Yoni Fogel

Refs Tokutek/ft-index#28 Fix compile failure on systems that don't support PR_SET_PTRACER

parent fa39b2a3
...@@ -177,8 +177,11 @@ failure: ...@@ -177,8 +177,11 @@ failure:
static void static void
spawn_gdb(const char *gdb_path) { spawn_gdb(const char *gdb_path) {
pid_t parent_pid = getpid(); pid_t parent_pid = getpid();
// Give permission for this process and (more importantly) all its children to debug this process. #if defined(PR_SET_PTRACER)
// On systems that require permission for the same user to ptrace,
// give permission for this process and (more importantly) all its children to debug this process.
prctl(PR_SET_PTRACER, parent_pid, 0, 0, 0); prctl(PR_SET_PTRACER, parent_pid, 0, 0, 0);
#endif
fprintf(stderr, "Attempting to use gdb @[%s] on pid[%d]\n", gdb_path, parent_pid); fprintf(stderr, "Attempting to use gdb @[%s] on pid[%d]\n", gdb_path, parent_pid);
fflush(stderr); fflush(stderr);
int intermediate_pid = fork(); int intermediate_pid = fork();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment