File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,19 +70,12 @@ void zend_startup_hrtime(void)
7070
7171 struct timespec ts ;
7272
73- #ifdef CLOCK_MONOTONIC_RAW
74- if (EXPECTED (0 == clock_gettime (CLOCK_MONOTONIC_RAW , & ts ))) {
75- zend_hrtime_posix_clock_id = CLOCK_MONOTONIC_RAW ;
76- return ;
77- }
78- #endif
79-
80- if (EXPECTED (0 == clock_gettime (zend_hrtime_posix_clock_id , & ts ))) {
73+ if (EXPECTED (0 == clock_gettime (CLOCK_MONOTONIC , & ts ))) {
8174 return ;
8275 }
8376
8477 // zend_error mechanism is not initialized at that point
85- fprintf (stderr , "No working CLOCK_MONOTONIC* found, this should never happen\n" );
78+ fprintf (stderr , "No working CLOCK_MONOTONIC found, this should never happen\n" );
8679 abort ();
8780
8881#endif
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ ZEND_API extern mach_timebase_info_data_t zend_hrtime_timerlib_info;
7272
7373#elif ZEND_HRTIME_PLATFORM_POSIX
7474
75+ /* Not read anymore, kept for ABI compatibility */
7576ZEND_API extern clockid_t zend_hrtime_posix_clock_id ;
7677
7778#endif
@@ -94,7 +95,7 @@ static zend_always_inline zend_hrtime_t zend_hrtime(void)
9495 return (zend_hrtime_t )mach_absolute_time () * zend_hrtime_timerlib_info .numer / zend_hrtime_timerlib_info .denom ;
9596#elif ZEND_HRTIME_PLATFORM_POSIX
9697 struct timespec ts = { .tv_sec = 0 , .tv_nsec = 0 };
97- clock_gettime (zend_hrtime_posix_clock_id , & ts );
98+ clock_gettime (CLOCK_MONOTONIC , & ts );
9899 return ((zend_hrtime_t ) ts .tv_sec * (zend_hrtime_t )ZEND_NANO_IN_SEC ) + ts .tv_nsec ;
99100#elif ZEND_HRTIME_PLATFORM_HPUX
100101 return (zend_hrtime_t ) gethrtime ();
You can’t perform that action at this time.
0 commit comments