From 4f4855b5e98bb5523e4cde2a5d58b8ac83368577 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sun, 12 Oct 2025 22:47:03 +0200 Subject: [PATCH] Implement dummy active TTY getter for FreeBSD Signed-off-by: AnErrupTion --- src/interop.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/interop.zig b/src/interop.zig index 0c30be7..bd4ed65 100644 --- a/src/interop.zig +++ b/src/interop.zig @@ -89,8 +89,8 @@ fn PlatformStruct() type { // 1. Open /proc/self/stat to retrieve the tty_nr field // 2. Parse the tty_nr field to extract the major and minor device // numbers - // 3. Then, read every /sys/class/tty/[dir]/dev, where [dir] is every - // sub-directory + // 3. Then, read every /sys/class/tty/[dir]/dev, where [dir] is + // every sub-directory // 4. Finally, compare the major and minor device numbers with the // extracted values. If they correspond, parse [dir] to get the // TTY ID @@ -178,6 +178,10 @@ fn PlatformStruct() type { const result = pwd.setusercontext(null, entry.passwd_struct, @intCast(entry.uid), pwd.LOGIN_SETALL); if (result != 0) return error.SetUserUidFailed; } + + pub fn getActiveTtyImpl(_: std.mem.Allocator) !u8 { + return error.FeatureUnimplemented; + } }, else => @compileError("Unsupported target: " ++ builtin.os.tag), };