mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
21 lines
547 B
Zig
21 lines
547 B
Zig
const std = @import("std");
|
|
const fs = std.fs;
|
|
|
|
pub fn main() !void {
|
|
var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){};
|
|
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
|