Path: blob/main/core/kernel/src/wasm/posix/stdlib.zig
1068 views
pub fn keepalive() void {}1const stdlib = @cImport(@cInclude("stdlib.h"));2const std = @import("std");3const expect = std.testing.expect;45// "The secure_getenv() function is intended for use in general-purpose libraries to avoid6// vulnerabilities that could occur if set-user-ID or set-group-ID programs accidentally7// trusted the environment." It is equal to getenv when this isn't an issue, and for8// webassembly it isn't.9export fn secure_getenv(name: [*:0]const u8) ?[*:0]u8 {10return std.c.getenv(name);11}1213// This is missing from zig's libc for some reason, so i just ported it from14// zig/lib/libc/wasi/libc-top-half/musl/src/locale/strtod_l.c15// since it is needed by numpy and is part of stdlib officially.1617// long double strtold_l(const char *restrict s, char **restrict p, locale_t l)18export fn strtold_l(s: [*c]const u8, p: [*c][*c]u8, l: *anyopaque) f128 {19_ = l;20return stdlib.strtold(s, p);21}222324