Skip to content

Commit 950b153

Browse files
committed
Avoid trying to use CLOCK_SGI_CYCLE on Android
The Android headers defines CLOCK_SGI_CYCLE but the call fails at runtime as it's not implemented. Combined with getticks() not checking the return value of clock_gettime() this causes bogus values to be returned from getticks().
1 parent 102f2fd commit 950b153

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/cycle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ INLINE_ELAPSED(__inline)
438438
#endif
439439
/*----------------------------------------------------------------*/
440440
/* SGI/Irix */
441-
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE) && !defined(HAVE_TICK_COUNTER)
441+
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE) && !defined(HAVE_TICK_COUNTER) && !defined(__ANDROID__)
442442
typedef struct timespec ticks;
443443

444444
static inline ticks getticks(void)

0 commit comments

Comments
 (0)