2024-04-25 01:41:47 +01:00
|
|
|
const std = @import("std");
|
|
|
|
const fs = std.fs;
|
|
|
|
|
|
|
|
pub fn main() !void {
|
2024-09-02 22:32:21 +01:00
|
|
|
var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .init;
|
2024-04-25 01:41:47 +01:00
|
|
|
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
|