mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
Implement dummy active TTY getter for FreeBSD
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -89,8 +89,8 @@ fn PlatformStruct() type {
|
|||||||
// 1. Open /proc/self/stat to retrieve the tty_nr field
|
// 1. Open /proc/self/stat to retrieve the tty_nr field
|
||||||
// 2. Parse the tty_nr field to extract the major and minor device
|
// 2. Parse the tty_nr field to extract the major and minor device
|
||||||
// numbers
|
// numbers
|
||||||
// 3. Then, read every /sys/class/tty/[dir]/dev, where [dir] is every
|
// 3. Then, read every /sys/class/tty/[dir]/dev, where [dir] is
|
||||||
// sub-directory
|
// every sub-directory
|
||||||
// 4. Finally, compare the major and minor device numbers with the
|
// 4. Finally, compare the major and minor device numbers with the
|
||||||
// extracted values. If they correspond, parse [dir] to get the
|
// extracted values. If they correspond, parse [dir] to get the
|
||||||
// TTY ID
|
// TTY ID
|
||||||
@@ -178,6 +178,10 @@ fn PlatformStruct() type {
|
|||||||
const result = pwd.setusercontext(null, entry.passwd_struct, @intCast(entry.uid), pwd.LOGIN_SETALL);
|
const result = pwd.setusercontext(null, entry.passwd_struct, @intCast(entry.uid), pwd.LOGIN_SETALL);
|
||||||
if (result != 0) return error.SetUserUidFailed;
|
if (result != 0) return error.SetUserUidFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn getActiveTtyImpl(_: std.mem.Allocator) !u8 {
|
||||||
|
return error.FeatureUnimplemented;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
else => @compileError("Unsupported target: " ++ builtin.os.tag),
|
else => @compileError("Unsupported target: " ++ builtin.os.tag),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user