+
+#ifndef HAVE_GETTIMEOFDAY
+int gettimeofday(struct timeval *tv, void *tz) {
+ tv->tv_sec = time(NULL);
+ tv->tv_usec = 0;
+ return 0;
+}
+#endif
+
+#ifndef HAVE_RANDOM
+#include <openssl/rand.h>
+
+long int random(void) {
+ long int x;
+
+ RAND_pseudo_bytes((unsigned char *)&x, sizeof(x));
+
+ return x;
+}
+#endif