Avatar
omochimetaru 10/7/2020 2:03 PM
でもなんかコスパに見合ってる感じがしないねえ。
2:04 PM
WASI libc implementation for WebAssembly. Contribute to WebAssembly/wasi-libc development by creating an account on GitHub.
2:04 PM
freopenがrenumberでかいてあるんだな
2:04 PM
これsyscallはどこに行くんだろ
2:04 PM
f2 = fopen(filename, mode); if (!f2) goto fail; if (f2->fd == f->fd) f2->fd = -1; /* avoid closing in fclose */ #ifdef __wasilibc_unmodified_upstream // WASI has no dup else if (__dup3(f2->fd, f->fd, fl&O_CLOEXEC)<0) goto fail2; #else // WASI doesn't have dup3, but does have a way to renumber // an existing file descriptor. else { if (__wasilibc_fd_renumber(f2->fd, f->fd)<0) goto fail2; f2->fd = -1; /* avoid closing in fclose */ } #endif