hyanantha               Thu Oct 24 07:29:51 2002 EDT

  Modified files:              (Branch: PHP_4_2_0)
    /php4/main  reentrancy.c 
  Log:
  NetWare related changes/modifications.
  
  
Index: php4/main/reentrancy.c
diff -u php4/main/reentrancy.c:1.33 php4/main/reentrancy.c:1.33.2.1
--- php4/main/reentrancy.c:1.33 Thu Feb 28 03:27:04 2002
+++ php4/main/reentrancy.c      Thu Oct 24 07:29:51 2002
@@ -28,6 +28,11 @@
 #include "win32/readdir.h"
 #endif
 
+#if defined(NETWARE) && !defined(NEW_LIBC)
+/*#include <ws2nlm.h>*/
+#include <sys/socket.h>
+#endif
+
 #include "php_reentrancy.h"
 #include "ext/standard/php_rand.h"                   /* for RAND_MAX */
 
@@ -113,6 +118,51 @@
 }
 
 #endif
+
+/*
+       Re-entrant versions of functions seem to be better for loading NLMs in 
+different address space.
+       Since we have them now in LibC, we might as well make use of them.
+*/
+#if defined(NETWARE)
+
+#define HAVE_LOCALTIME_R 1
+#define HAVE_CTIME_R 1
+#define HAVE_ASCTIME_R 1
+#define HAVE_GMTIME_R 1
+
+PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm)
+{
+    /* Modified according to LibC definition : Venkat (1/5/02) */
+       if (localtime_r(timep, p_tm) != NULL)
+               return (p_tm);
+       return (NULL);
+}
+
+PHPAPI char *php_ctime_r(const time_t *clock, char *buf)
+{
+    /* Modified according to LibC definition : Venkat (30/4/02) */
+       if (ctime_r(clock, buf) != NULL)
+               return (buf);
+       return (NULL);
+}
+
+PHPAPI char *php_asctime_r(const struct tm *tm, char *buf)
+{
+    /* Modified according to LibC definition : Venkat (30/4/02) */
+       if (asctime_r(tm, buf) != NULL)
+               return (buf);
+       return (NULL);
+}
+
+PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm)
+{
+    /* Modified according to LibC definition : Venkat (1/5/02) */
+       if (gmtime_r(timep, p_tm) != NULL)
+               return (p_tm);
+       return (NULL);
+}
+
+#endif /* NETWARE */
 
 #if !defined(HAVE_POSIX_READDIR_R)
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to