diff options
| author | Sascha Schumann <sas@php.net> | 2001-05-20 21:29:55 +0000 |
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 2001-05-20 21:29:55 +0000 |
| commit | ff5a9de31d886f6b052eedaad28f39a878ec55b4 (patch) | |
| tree | 7204010e804527cc27aa9a56a17e15457ac21c4f /main | |
| parent | 7dfce52fdc73147b783b50e2ef3ff9944b84f02c (diff) | |
| download | php-git-ff5a9de31d886f6b052eedaad28f39a878ec55b4.tar.gz | |
Support for IRIX-style asctime_r/ctime_r.
Diffstat (limited to 'main')
| -rw-r--r-- | main/php_reentrancy.h | 6 | ||||
| -rw-r--r-- | main/reentrancy.c | 21 |
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 |
