Skip to content
Snippets Groups Projects
Commit 9c27e87a authored by Moe Jette's avatar Moe Jette
Browse files

Add support for AIX's five argument ptrace function (Linux has four args).

parent b260c433
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ documents those changes that are of interest to users and admins. ...@@ -10,6 +10,7 @@ documents those changes that are of interest to users and admins.
responding in a timely fashion) then send a registration RPC responding in a timely fashion) then send a registration RPC
to slurmctld to slurmctld
-- Add "slurm_" prefix to slurm's hostlist_ function man pages. -- Add "slurm_" prefix to slurm's hostlist_ function man pages.
-- More AIX support added.
* Changes in SLURM 0.3.1 * Changes in SLURM 0.3.1
======================== ========================
......
...@@ -12,6 +12,7 @@ EXTRA_DIST = \ ...@@ -12,6 +12,7 @@ EXTRA_DIST = \
x_ac_debug.m4 \ x_ac_debug.m4 \
x_ac_elan.m4 \ x_ac_elan.m4 \
x_ac_gpl_licensed.m4 \ x_ac_gpl_licensed.m4 \
x_ac_ptrace.m4 \
x_ac_readline.m4 \ x_ac_readline.m4 \
x_ac_setproctitle.m4 \ x_ac_setproctitle.m4 \
x_ac_slurm_ssl.m4 x_ac_slurm_ssl.m4
##*****************************************************************************
# $Id$
##*****************************************************************************
# AUTHOR:
# Morris Jette <jette1@llnl.gov>
#
# SYNOPSIS:
# X_AC_PTRACE
#
# DESCRIPTION:
# Test argument count of ptrace function.
#
# WARNINGS:
# This macro must be placed after AC_PROG_CC or equivalent.
##*****************************************************************************
AC_DEFUN([X_AC_PTRACE], [
AC_TRY_COMPILE(
[#include <sys/reg.h>
#include <sys/ptrace.h>
#include <sys/ldr.h>],
[ptrace(PT_TRACE_ME,0,0,0,0);],
[AC_DEFINE(PTRACE_FIVE_ARGS, 1,
[Define to 1 if ptrace takes five arguments.])])
])
...@@ -58,6 +58,9 @@ dnl check to see if glibc's program_invocation_short_name is available: ...@@ -58,6 +58,9 @@ dnl check to see if glibc's program_invocation_short_name is available:
dnl dnl
X_AC_SLURM_PROGRAM_INVOCATION_SHORT_NAME X_AC_SLURM_PROGRAM_INVOCATION_SHORT_NAME
dnl Check if ptrace takes four or five arguments
dnl
X_AC_PTRACE
dnl Checks for types. dnl Checks for types.
dnl dnl
......
...@@ -562,7 +562,11 @@ _pdebug_trace_process(slurmd_job_t *job, pid_t pid) ...@@ -562,7 +562,11 @@ _pdebug_trace_process(slurmd_job_t *job, pid_t pid)
waitpid(pid, &status, WUNTRACED); waitpid(pid, &status, WUNTRACED);
if (kill(pid, SIGSTOP) < 0) if (kill(pid, SIGSTOP) < 0)
error("kill(%lu): %m", (unsigned long) pid); error("kill(%lu): %m", (unsigned long) pid);
#ifdef PTRACE_FIVE_ARGS
if (ptrace(PTRACE_DETACH, (long) pid, NULL, 0, NULL))
#else
if (ptrace(PTRACE_DETACH, (long) pid, NULL, NULL)) if (ptrace(PTRACE_DETACH, (long) pid, NULL, NULL))
#endif
error("ptrace(%lu): %m", (unsigned long) pid); error("ptrace(%lu): %m", (unsigned long) pid);
} }
} }
...@@ -577,6 +581,10 @@ _pdebug_stop_current(slurmd_job_t *job) ...@@ -577,6 +581,10 @@ _pdebug_stop_current(slurmd_job_t *job)
* Stop the task on exec for TotalView to connect * Stop the task on exec for TotalView to connect
*/ */
if ( (job->task_flags & TASK_PARALLEL_DEBUG) if ( (job->task_flags & TASK_PARALLEL_DEBUG)
#ifdef PTRACE_FIVE_ARGS
&& (ptrace(PTRACE_TRACEME, 0, NULL, 0, NULL) < 0) )
#else
&& (ptrace(PTRACE_TRACEME, 0, NULL, NULL) < 0) ) && (ptrace(PTRACE_TRACEME, 0, NULL, NULL) < 0) )
#endif
error("ptrace: %m"); error("ptrace: %m");
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment