src: add x86_64 support

This commit is contained in:
rifsxd
2025-05-24 16:56:24 +06:00
committed by Rifat Azad
parent db223a1e92
commit 44ad960da7
22 changed files with 273 additions and 22 deletions

View File

@@ -202,6 +202,10 @@ pub fn root_shell() -> Result<()> {
if free_idx < matches.free.len() {
let name = &matches.free[free_idx];
uid = unsafe {
#[cfg(target_arch = "x86_64")]
let pw = libc::getpwnam(name.as_ptr() as *const i8).as_ref();
#[cfg(not(target_arch = "x86_64"))]
let pw = libc::getpwnam(name.as_ptr()).as_ref();
match pw {
Some(pw) => pw.pw_uid,