Linux: Map Alpha getx*id to their regularly named versions

These syscalls also store the value of `euid/egid/ppid` in `r20`, but
are otherwise the same.
This commit is contained in:
Stephen Gregoratto
2026-02-20 12:34:29 +11:00
committed by Alex Rønne Petersen
parent 7534ac7367
commit a9b7df4ca2
3 changed files with 9 additions and 7 deletions
+1 -4
View File
@@ -2266,10 +2266,7 @@ pub fn getsid(pid: pid_t) usize {
pub fn getpid() pid_t {
// Casts result to a pid_t, safety-checking >= 0, because getpid() cannot fail
return @intCast(@as(u32, @truncate(syscall0(comptime switch (native_arch) {
.alpha => .getxpid,
else => .getpid,
}))));
return @intCast(@as(u32, @truncate(syscall0(.getpid))));
}
pub fn getppid() pid_t {
+3 -3
View File
@@ -5872,11 +5872,11 @@ pub const Alpha = enum(usize) {
brk = 17,
osf_getfsstat = 18,
lseek = 19,
getxpid = 20,
getpid = 20,
osf_mount = 21,
umount2 = 22,
setuid = 23,
getxuid = 24,
getuid = 24,
exec_with_loader = 25,
ptrace = 26,
osf_nrecvmsg = 27,
@@ -5899,7 +5899,7 @@ pub const Alpha = enum(usize) {
osf_profil = 44,
open = 45,
osf_old_sigaction = 46,
getxgid = 47,
getgid = 47,
osf_sigprocmask = 48,
osf_getlogin = 49,
osf_setlogin = 50,
+5
View File
@@ -28,6 +28,11 @@ const stdlib_renames = std.StaticStringMap([]const u8).initComptime(.{
// ARM EABI/Thumb.
.{ "arm_sync_file_range", "sync_file_range" },
.{ "arm_fadvise64_64", "fadvise64_64" },
// Alpha
// See https://github.com/torvalds/linux/blob/8bf22c33e7a172fbc72464f4cc484d23a6b412ba/arch/alpha/include/uapi/asm/unistd.h#L10
.{ "getxpid", "getpid" },
.{ "getxuid", "getuid" },
.{ "getxgid", "getgid" },
});
/// Filter syscalls that aren't actually syscalls.