X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=runtime%2Fruntime.c;h=ceb67729f79ba7e7518736cf9d6812607630520f;hp=c41a1bdaa895364ee9440286de33315c31dacc98;hb=6b4f3ea4891b6c0e65dfd6d41f49aee2daa9e23d;hpb=052506ff082f134f00834f666653819e18d9bddf diff --git a/runtime/runtime.c b/runtime/runtime.c index c41a1bd..ceb6772 100644 --- a/runtime/runtime.c +++ b/runtime/runtime.c @@ -2,10 +2,12 @@ * 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" -#include "runtime_local.h" +#include "rlocal.h" #include "mem.h" #include "tls.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);