Skip to content

Commit 8c05c51

Browse files
committed
Revert "apc_time: use monotonic clock if available"
This reverts commit eb28fe1. As reported in #451, this makes the timestamps used by apcu inconsistent with time(), which people may have reasonably relied on.
1 parent 5015af4 commit 8c05c51

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

apc_time.c

-6
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ time_t apc_time(void)
3434
APCG(request_time) = (time_t) sapi_get_request_time();
3535
return APCG(request_time);
3636
} else {
37-
#ifdef HAVE_CLOCK_GETTIME
38-
struct timespec ts;
39-
clock_gettime(CLOCK_MONOTONIC, &ts);
40-
return ts.tv_sec;
41-
#else
4237
return time(0);
43-
#endif
4438
}
4539
}
4640

config.m4

-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ if test "$PHP_APCU" != "no"; then
200200
fi
201201
fi
202202

203-
AC_CHECK_FUNCS(clock_gettime)
204203
AC_CHECK_FUNCS(sigaction)
205204
AC_CACHE_CHECK(for union semun, php_cv_semun,
206205
[

package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</stability>
4040
<license uri="http://www.php.net/license">PHP License</license>
4141
<notes>
42-
-
42+
- Revert use of monotonic clock for TTL (#451)
4343
</notes>
4444
<contents>
4545
<dir name="/">

0 commit comments

Comments
 (0)