Skip to content

Commit b032da9

Browse files
ammarioclaude
andcommitted
Use absolute path ::libc for libc functions
In Rust 2018+, we need to use the full path ::libc:: to access libc functions when it's not explicitly imported. 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ea6641a commit b032da9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/jail/linux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl LinuxJail {
4444
fn check_root() -> Result<()> {
4545
// Check UID directly using libc
4646
#[cfg(target_os = "linux")]
47-
let uid = unsafe { libc::getuid() };
47+
let uid = unsafe { ::libc::getuid() };
4848
#[cfg(not(target_os = "linux"))]
4949
let uid = 1000; // Non-root UID for non-Linux platforms
5050

@@ -411,7 +411,7 @@ impl LinuxJail {
411411
if let Ok(pid) = parts[1].parse::<u32>() {
412412
// Check if process still exists
413413
#[cfg(target_os = "linux")]
414-
let exists = unsafe { libc::kill(pid as i32, 0) == 0 };
414+
let exists = unsafe { ::libc::kill(pid as i32, 0) == 0 };
415415
#[cfg(not(target_os = "linux"))]
416416
let exists = false; // Assume process doesn't exist on non-Linux
417417

0 commit comments

Comments
 (0)