authorgravatar for iridescentrosesfall@gmail.comNathan Bourgeois <iridescentrosesfall@gmail.com> 2026-03-21 03:23:11-04:00
committergravatar for iridescentrosesfall@gmail.comNathan Bourgeois <iridescentrosesfall@gmail.com> 2026-03-21 06:34:45-04:00
log2037dba90f5815f6fc3137c2485e908700c009e5
tree557415a72fb5c2fddae6f7a876fccae21d7aed88
parentfdf19984b8af9781cd68dda3fcbcc44ac8ade80e

std.posix: Minimal set to build an Io on PSP


2 files changed, 17 insertions(+), 1 deletions(-)

lib/std/Io/Dir.zig+1-1
......@@ -52,7 +52,7 @@ pub const max_path_bytes = switch (native_os) {
5252/// On WASI, file name components are encoded as valid UTF-8.
5353/// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding.
5454pub const max_name_bytes = switch (native_os) {
55 .linux, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .freebsd, .openbsd, .netbsd, .dragonfly, .illumos, .serenity => std.posix.NAME_MAX,
55 .linux, .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos, .freebsd, .openbsd, .netbsd, .dragonfly, .illumos, .serenity, .psp => std.posix.NAME_MAX,
5656 // Haiku's NAME_MAX includes the null terminator, so subtract one.
5757 .haiku => std.posix.NAME_MAX - 1,
5858 // Each WTF-16LE character may be expanded to 3 WTF-8 bytes.
lib/std/posix.zig+16
......@@ -38,6 +38,22 @@ pub const system = if (use_libc)
3838else switch (native_os) {
3939 .linux => linux,
4040 .plan9 => std.os.plan9,
41 .psp => struct {
42 pub const fd_t = i32;
43 pub const pid_t = void;
44 pub const pollfd = void;
45 pub const uid_t = void;
46 pub const gid_t = void;
47 pub const mode_t = u32;
48 pub const nlink_t = u32;
49 pub const blksize_t = u32;
50 pub const ino_t = u64;
51 pub const IFNAMESIZE = {};
52 pub const SIG = void;
53
54 // https://github.com/pspdev/newlib/blob/9e0a073634ad73e8e088f2e071c55a9fe5d39709/newlib/libc/sys/psp/sys/dirent.h#L19
55 pub const NAME_MAX = 255;
56 },
4157 else => struct {
4258 pub const pid_t = void;
4359 pub const pollfd = void;