Commit a7964a3f authored by Matthew Brandyberry's avatar Matthew Brandyberry
Browse files

Implement GetThreadCount for AIX.

parent 0dd5ef8b
......@@ -58,6 +58,10 @@
# include <sys/procfs.h>
#endif // GTEST_OS_QNX
#if GTEST_OS_AIX
# include <procinfo.h>
#endif // GTEST_OS_AIX
#include "gtest/gtest-spi.h"
#include "gtest/gtest-message.h"
#include "gtest/internal/gtest-internal.h"
......@@ -146,6 +150,19 @@ size_t GetThreadCount() {
}
}
#elif GTEST_OS_AIX
size_t GetThreadCount() {
struct procentry64 entry;
pid_t pid = getpid();
int status = getprocs64(&entry, sizeof(entry), NULL, 0, &pid, 1);
if (status == 1) {
return entry.pi_thcount;
} else {
return 0;
}
}
#else
size_t GetThreadCount() {
......
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