|
@@ -1,5 +1,6 @@
|
|
#include <time.h>
|
|
#include <time.h>
|
|
#include <stdint.h>
|
|
#include <stdint.h>
|
|
|
|
+#include "pthread_impl.h"
|
|
|
|
|
|
/* This assumes that a check for the
|
|
/* This assumes that a check for the
|
|
template size has already been made */
|
|
template size has already been made */
|
|
@@ -10,7 +11,7 @@ char *__randname(char *template)
|
|
unsigned long r;
|
|
unsigned long r;
|
|
|
|
|
|
__clock_gettime(CLOCK_REALTIME, &ts);
|
|
__clock_gettime(CLOCK_REALTIME, &ts);
|
|
- r = ts.tv_nsec*65537 ^ (uintptr_t)&ts / 16 + (uintptr_t)template;
|
|
|
|
|
|
+ r = ts.tv_nsec + __pthread_self()->tid * 65537UL;
|
|
for (i=0; i<6; i++, r>>=5)
|
|
for (i=0; i<6; i++, r>>=5)
|
|
template[i] = 'A'+(r&15)+(r&16)*2;
|
|
template[i] = 'A'+(r&15)+(r&16)*2;
|
|
|
|
|