From 178176b5bf51f66562917273986f699f91e969e2 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Tue, 23 Jun 2020 16:27:58 -0400 Subject: [PATCH] [wasm] Make some libc stubs return an error instead of asserting. (#38256) Fixes https://github.com/dotnet/runtime/issues/38164. --- src/mono/mono/mini/mini-wasm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mono/mono/mini/mini-wasm.c b/src/mono/mono/mini/mini-wasm.c index 5254a3b52c19e..11efa13d3e0e3 100644 --- a/src/mono/mono/mini/mini-wasm.c +++ b/src/mono/mono/mini/mini-wasm.c @@ -761,24 +761,24 @@ ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count); ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) { - g_error ("sendfile"); - return 0; + errno = ENOTSUP; + return -1; } int getpwnam_r (const char *name, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result) { - g_error ("getpwnam_r"); - return 0; + *result = NULL; + return ENOTSUP; } int getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result) { - g_error ("getpwuid_r"); - return 0; + *result = NULL; + return ENOTSUP; } G_END_DECLS