std.debug: Gracefully handle process_vm_readv() EPERM in MemoryAccessor.read().

Closes #21815.
This commit is contained in:
Alex Rønne Petersen 2024-11-12 16:59:22 +01:00
parent a5d4ad17b7
commit f845fa04a0

View File

@ -48,7 +48,8 @@ fn read(ma: *MemoryAccessor, address: usize, buf: []u8) bool {
switch (linux.E.init(bytes_read)) {
.SUCCESS => return bytes_read == buf.len,
.FAULT => return false,
.INVAL, .PERM, .SRCH => unreachable, // own pid is always valid
.INVAL, .SRCH => unreachable, // own pid is always valid
.PERM => {}, // Known to happen in containers.
.NOMEM => {},
.NOSYS => {}, // QEMU is known not to implement this syscall.
else => unreachable, // unexpected