Skip to content

Commit

Permalink
Put ifdefs around Linux-specific header/function.
Browse files Browse the repository at this point in the history
Closes #2366.
  • Loading branch information
cybersphinx committed Nov 30, 2010
1 parent 8f543b4 commit 2d4d2d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/exceptionhandler/exceptionhandler.c
Expand Up @@ -122,10 +122,12 @@ static LONG WINAPI windowsExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo)
# include <sys/stat.h>
# include <sys/wait.h>
# include <sys/utsname.h>
#ifdef WZ_OS_LINUX
# include <sys/prctl.h>
#ifndef PR_SET_PTRACER
# define PR_SET_PTRACER 0x59616d61 // prctl will ignore unknown options
#endif
#endif

// GNU extension for backtrace():
# if defined(__GLIBC__)
Expand Down Expand Up @@ -492,8 +494,10 @@ static pid_t execGdb(int const dumpFile, int* gdbWritePipe)
// Check to see if we're the parent
if (pid != 0)
{
#ifdef WZ_OS_LINUX
// Allow tracing the process, some hardened kernel configurations disallow this.
prctl(PR_SET_PTRACER, pid, 0, 0, 0);
#endif

// Return the write end of the pipe
*gdbWritePipe = gdbPipe[1];
Expand Down

0 comments on commit 2d4d2d8

Please sign in to comment.