Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
ddb8012e
Commit
ddb8012e
authored
Dec 10, 2015
by
Billy Donahue
Browse files
Merge pull request #602 from mtbrandy/threadcount_aix
Implement GetThreadCount for AIX.
parents
0162ff72
bf7e9e8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
googletest/src/gtest-port.cc
googletest/src/gtest-port.cc
+18
-0
No files found.
googletest/src/gtest-port.cc
View file @
ddb8012e
...
...
@@ -58,6 +58,11 @@
# include <sys/procfs.h>
#endif // GTEST_OS_QNX
#if GTEST_OS_AIX
# include <procinfo.h>
# include <sys/types.h>
#endif // GTEST_OS_AIX
#include "gtest/gtest-spi.h"
#include "gtest/gtest-message.h"
#include "gtest/internal/gtest-internal.h"
...
...
@@ -146,6 +151,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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment