Add limited support for WebAssembly WASI target
CLA: trivial Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21344)
This commit is contained in:
parent
3e76b38852
commit
d88a0f5f39
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#if defined(OPENSSL_SYS_WINCE)
|
#if defined(OPENSSL_SYS_WINCE)
|
||||||
#elif defined(OPENSSL_SYS_WIN32)
|
#elif defined(OPENSSL_SYS_WIN32)
|
||||||
|
#elif defined(__wasi__)
|
||||||
|
# define NO_SYSLOG
|
||||||
#elif defined(OPENSSL_SYS_VMS)
|
#elif defined(OPENSSL_SYS_VMS)
|
||||||
# include <opcdef.h>
|
# include <opcdef.h>
|
||||||
# include <descrip.h>
|
# include <descrip.h>
|
||||||
|
@ -395,6 +395,10 @@ static ssize_t syscall_random(void *buf, size_t buflen)
|
|||||||
# elif (defined(__DragonFly__) && __DragonFly_version >= 500700) \
|
# elif (defined(__DragonFly__) && __DragonFly_version >= 500700) \
|
||||||
|| (defined(__NetBSD__) && __NetBSD_Version >= 1000000000)
|
|| (defined(__NetBSD__) && __NetBSD_Version >= 1000000000)
|
||||||
return getrandom(buf, buflen, 0);
|
return getrandom(buf, buflen, 0);
|
||||||
|
# elif defined(__wasi__)
|
||||||
|
if (getentropy(buf, buflen) == 0)
|
||||||
|
return (ssize_t)buflen;
|
||||||
|
return -1;
|
||||||
# else
|
# else
|
||||||
errno = ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user