summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/php_reentrancy.h6
-rw-r--r--main/reentrancy.c21
2 files changed, 26 insertions, 1 deletions
diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h
index 691392f7c9..8e9c674a14 100644
--- a/main/php_reentrancy.h
+++ b/main/php_reentrancy.h
@@ -36,8 +36,12 @@
#define HAVE_ASCTIME 1
#define HAVE_CTIME 1
+#if defined(PHP_IRIX_TIME_R)
+#undef HAVE_ASCTIME_R
+#undef HAVE_CTIME_R
+#endif
-#ifdef PHP_HPUX_TIME_R
+#if defined(PHP_HPUX_TIME_R)
#undef HAVE_LOCALTIME_R
#undef HAVE_ASCTIME_R
#undef HAVE_CTIME_R
diff --git a/main/reentrancy.c b/main/reentrancy.c
index a6a7cc563a..d4049ee77d 100644
--- a/main/reentrancy.c
+++ b/main/reentrancy.c
@@ -56,6 +56,27 @@ static MUTEX_T reentrant_locks[NUMBER_OF_LOCKS];
#endif
+#if defined(PHP_IRIX_TIME_R)
+
+#define HAVE_CTIME_R 1
+#define HAVE_ASCTIME_R 1
+
+PHPAPI char *php_ctime_r(const time_t *clock, char *buf)
+{
+ if (ctime_r(clock, buf, 26) == buf)
+ return (buf);
+ return (NULL);
+}
+
+PHPAPI char *php_asctime_r(const struct tm *tm, char *buf)
+{
+ if (asctime_r(tm, buf, 26) == buf)
+ return (buf);
+ return (NULL);
+}
+
+#endif
+
#if defined(PHP_HPUX_TIME_R)
#define HAVE_LOCALTIME_R 1