bnicholes 01/08/07 14:48:34
Modified: misc/unix getuuid.c
Log:
Added the NetWare specific calls to enable get_random_info()
Revision Changes Path
1.12 +11 -6 apr/misc/unix/getuuid.c
Index: getuuid.c
===================================================================
RCS file: /home/cvs/apr/misc/unix/getuuid.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- getuuid.c 2001/08/06 20:49:17 1.11
+++ getuuid.c 2001/08/07 21:48:34 1.12
@@ -99,15 +99,24 @@
* replace with pid/tid for portability (in the spirit of mod_unique_id)
*/
struct {
/* Add thread id here, if applicable, when we get to pthread or apr */
- pid_t pid;
+ pid_t pid;
+#ifdef NETWARE
+ apr_uint64_t t;
+#else
struct timeval t;
+#endif
char hostname[257];
} r;
apr_md5_init(&c);
+#ifdef NETWARE
+ r.pid = NXThreadGetId();
+ NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &(r.t));
+#else
r.pid = getpid();
gettimeofday(&r.t, (struct timezone *)0);
+#endif
gethostname(r.hostname, 256);
apr_md5_update(&c, (const unsigned char *)&r, sizeof(r));
apr_md5_final(seed, &c);
@@ -130,13 +139,9 @@
{
#ifdef NETWARE
uint64_t sec;
- uint64_t usec;
NXGetTime(NX_SINCE_1970, NX_SECONDS, &sec);
- NXGetTime(NX_SINCE_1970, NX_USECONDS, &usec);
- *uuid_time = (sec * 10000000) + (usec * 10) +
- 0x01B21DD213814000LL;
-EnterDebugger(); /* Check to make sure that we are actually getting what we
expect. */
+ *uuid_time = (sec * 10000000) + 0x01B21DD213814000LL;
#else
struct timeval tp;