Skip to content

Commit 6361863

Browse files
Added AIX version of ptrace
1 parent 04313b8 commit 6361863

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lldb/source/Host/posix/ProcessLauncherPosixFork.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include <sys/wait.h>
2222
#include <unistd.h>
2323

24-
#include <sstream>
2524
#include <csignal>
25+
#include <sstream>
2626

2727
#ifdef __ANDROID__
2828
#include <android/api-level.h>
@@ -47,8 +47,7 @@ static void write_string(int error_fd, const char *str) {
4747
(void)r;
4848
}
4949

50-
[[noreturn]] static void ExitWithError(int error_fd,
51-
const char *operation) {
50+
[[noreturn]] static void ExitWithError(int error_fd, const char *operation) {
5251
int err = errno;
5352
write_string(error_fd, operation);
5453
write_string(error_fd, " failed: ");
@@ -193,8 +192,13 @@ struct ForkLaunchInfo {
193192
}
194193

195194
// Start tracing this child that is about to exec.
195+
#if !defined(_AIX)
196196
if (ptrace(PT_TRACE_ME, 0, nullptr, 0) == -1)
197197
ExitWithError(error_fd, "ptrace");
198+
#else
199+
if (ptrace64(PT_TRACE_ME, 0, 0, 0, nullptr) == -1)
200+
ExitWithError(error_fd, "ptrace");
201+
#endif
198202
}
199203

200204
// Execute. We should never return...

0 commit comments

Comments
 (0)