]> pd.if.org Git - nbds/blobdiff - runtime/runtime.c
port to 32 bit x86 linux
[nbds] / runtime / runtime.c
index d4946cfc0b47dd8fb8e673915786a41e44eb4958..ceb67729f79ba7e7518736cf9d6812607630520f 100644 (file)
@@ -2,6 +2,8 @@
  * Written by Josh Dybnis and released to the public domain, as explained at
  * http://creativecommons.org/licenses/publicdomain
  */
+#define _POSIX_C_SOURCE 1 // for rand_r()
+#include <stdlib.h>
 #include <pthread.h>
 #include "common.h"
 #include "runtime.h"
@@ -18,8 +20,8 @@ typedef struct thread_info {
     void *restrict arg;
 } thread_info_t;
 
-void nbd_init (void) {
-    sranddev();
+__attribute__ ((constructor)) void nbd_init (void) {
+    //sranddev();
     INIT_THREAD_LOCAL(rand_seed_);
     INIT_THREAD_LOCAL(tid_);
     SET_THREAD_LOCAL(tid_, 0);