Fix pthread_getcpuclockid.
clock_gettime was returning EINVAL for the values produced by pthread_getcpuclockid. Bug: 10346183 Change-Id: Iabe643d7d46110bb311a0367aa0fc737f653208e
This commit is contained in:
@@ -278,6 +278,16 @@ TEST(pthread, pthread_detach__no_such_thread) {
|
||||
ASSERT_EQ(ESRCH, pthread_detach(dead_thread));
|
||||
}
|
||||
|
||||
TEST(pthread, pthread_getcpuclockid__clock_gettime) {
|
||||
pthread_t t;
|
||||
ASSERT_EQ(0, pthread_create(&t, NULL, SleepFn, reinterpret_cast<void*>(5)));
|
||||
|
||||
clockid_t c;
|
||||
ASSERT_EQ(0, pthread_getcpuclockid(t, &c));
|
||||
timespec ts;
|
||||
ASSERT_EQ(0, clock_gettime(c, &ts));
|
||||
}
|
||||
|
||||
TEST(pthread, pthread_getcpuclockid__no_such_thread) {
|
||||
pthread_t dead_thread;
|
||||
MakeDeadThread(dead_thread);
|
||||
|
Reference in New Issue
Block a user