Skip to content

Commit 178176b

Browse files
authored
[wasm] Make some libc stubs return an error instead of asserting. (dotnet#38256)
Fixes dotnet#38164.
1 parent 4046b5e commit 178176b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/mono/mono/mini/mini-wasm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -761,24 +761,24 @@ ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
761761

762762
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
763763
{
764-
g_error ("sendfile");
765-
return 0;
764+
errno = ENOTSUP;
765+
return -1;
766766
}
767767

768768
int
769769
getpwnam_r (const char *name, struct passwd *pwd, char *buffer, size_t bufsize,
770770
struct passwd **result)
771771
{
772-
g_error ("getpwnam_r");
773-
return 0;
772+
*result = NULL;
773+
return ENOTSUP;
774774
}
775775

776776
int
777777
getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize,
778778
struct passwd **result)
779779
{
780-
g_error ("getpwuid_r");
781-
return 0;
780+
*result = NULL;
781+
return ENOTSUP;
782782
}
783783

784784
G_END_DECLS

0 commit comments

Comments
 (0)