X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=runtime%2Fruntime.c;h=b145faa872e5826ed70a979d724a561cdc24738a;hp=d4946cfc0b47dd8fb8e673915786a41e44eb4958;hb=0f6e9afb06b03647c4c5f2499ddab12f42b4340e;hpb=d791fc64b23a9c0a3ed90aa60571344d7735aee9 diff --git a/runtime/runtime.c b/runtime/runtime.c index d4946cf..b145faa 100644 --- a/runtime/runtime.c +++ b/runtime/runtime.c @@ -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 #include #include "common.h" #include "runtime.h" @@ -18,12 +20,11 @@ typedef struct thread_info { void *restrict arg; } thread_info_t; -void nbd_init (void) { - sranddev(); +__attribute__ ((constructor(102))) void nbd_init (void) { + //sranddev(); INIT_THREAD_LOCAL(rand_seed_); INIT_THREAD_LOCAL(tid_); SET_THREAD_LOCAL(tid_, 0); - mem_init(); lwt_thread_init(0); rcu_thread_init(0); }