diff --git a/.gitmodules b/.gitmodules index dd558f464..7cc8ed5b8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,6 +7,9 @@ [submodule "subprojects/h2o"] path = subprojects/libh2o url = https://github.com/urbit/h2o.git +[submodule "subprojects/libent"] + path = subprojects/libent + url = https://github.com/urbit/libent.git [submodule "subprojects/libuv"] path = subprojects/libuv url = https://github.com/urbit/libuv.git diff --git a/include/c/portable.h b/include/c/portable.h index 2314e7ded..fbba13d86 100644 --- a/include/c/portable.h +++ b/include/c/portable.h @@ -183,17 +183,6 @@ # define lseek64 lseek # else # error "port: timeconvert" -# endif - - /* Entropy. - */ -# if defined(U3_OS_linux) -# define c3_getentropy(B, L) \ - ((L) == syscall(SYS_getrandom, B, L, 0) ? 0 : -1) -# elif defined(U3_OS_bsd) || defined(U3_OS_osx) -# define c3_getentropy getentropy -# else -# error "port: getentropy" # endif /* Static assertion. diff --git a/meson.build b/meson.build index da71dbfeb..d336fdd74 100644 --- a/meson.build +++ b/meson.build @@ -320,6 +320,7 @@ endif # For these libs we provide fallback bundle argon2_dep = dependency('argon2', version: '>=1', fallback: ['argon2', 'argon2_dep']) ed25519_dep = dependency('ed25519', version: '>=0.1.0', fallback: ['ed25519', 'ed25519_dep']) +libent_dep = dependency('libent', version: '>=0.1.3', fallback: ['libent', 'libent_dep']) libh2o_dep = dependency('libh2o', version: '>=0.13.3', fallback: ['libh2o', 'libh2o_dep']) libscrypt_dep = dependency('libscrypt', version: '>=0.1.21', fallback: ['libscrypt', 'libscrypt_dep']) libsni_dep = dependency('libsni', version: '>=0.5.0', fallback: ['libsni', 'libsni_dep']) @@ -332,6 +333,7 @@ deps = [argon2_dep, curl_dep, ed25519_dep, gmp_dep, + libent_dep, libh2o_dep, libscrypt_dep, libsni_dep, diff --git a/subprojects/libent b/subprojects/libent new file mode 160000 index 000000000..7506fb315 --- /dev/null +++ b/subprojects/libent @@ -0,0 +1 @@ +Subproject commit 7506fb31577fc5e185b31ed9f6ce6072e3f20637 diff --git a/vere/sist.c b/vere/sist.c index 6a938703c..e7a7ad8e5 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -1,6 +1,7 @@ /* vere/sist.c ** */ +#include #include #include #include @@ -406,7 +407,7 @@ _sist_bask(c3_c* pop_c, u3_noun may) void c3_rand(c3_w* rad_w) { - if ( 0 != c3_getentropy(rad_w, 64) ) { + if ( 0 != ent_getentropy(rad_w, 64) ) { uL(fprintf(uH, "c3_rand getentropy: %s\n", strerror(errno))); u3_lo_bail(); }