This is done via wasi-libc and the WASI interface, for ease of maintenance (only one implementation for both WASI and JS/browsers).