mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
21 lines
552 B
Zig
21 lines
552 B
Zig
const std = @import("std");
|
|
const fs = std.fs;
|
|
|
|
pub fn main() !void {
|
|
var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .init;
|
|
const gpa = general_purpose_allocator.allocator();
|
|
|
|
var arena_instance = std.heap.ArenaAllocator.init(gpa);
|
|
defer arena_instance.deinit();
|
|
const arena = arena_instance.allocator();
|
|
|
|
const preopens = try fs.wasi.preopensAlloc(arena);
|
|
|
|
for (preopens.names, 0..) |preopen, i| {
|
|
std.debug.print("{}: {s}\n", .{ i, preopen });
|
|
}
|
|
}
|
|
|
|
// exe=succeed
|
|
// target=wasm32-wasi
|