From e804498d070d81b8d93d80dac2a173ae32665fde Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Mon, 22 Jun 2020 23:56:52 -0400 Subject: [PATCH] [wasm] Make some libc stubs return an error instead of asserting. 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 fc25535b433f0..47244fb173aa4 100644 --- a/src/mono/mono/mini/mini-wasm.c +++ b/src/mono/mono/mini/mini-wasm.c @@ -722,24 +722,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