@@ -491,7 +491,7 @@ impl ProcessInformation {
491491
492492 pub fn current_process_info ( ) -> Result < ProcessInformation , io:: Error > {
493493 #[ cfg( target_os = "linux" ) ]
494- let pid = uucore :: process:: getpid ( ) ;
494+ let pid = rustix :: process:: getpid ( ) . as_raw_pid ( ) ;
495495 #[ cfg( not( target_os = "linux" ) ) ]
496496 let pid = 0 ; // dummy
497497
@@ -798,9 +798,9 @@ pub fn walk_threads() -> impl Iterator<Item = ProcessInformation> {
798798mod tests {
799799 use super :: * ;
800800 #[ cfg( target_os = "linux" ) ]
801- use std :: collections :: HashSet ;
801+ use rustix :: process :: getpid ;
802802 #[ cfg( target_os = "linux" ) ]
803- use uucore :: process :: getpid ;
803+ use std :: collections :: HashSet ;
804804
805805 #[ test]
806806 #[ cfg( target_os = "linux" ) ]
@@ -870,7 +870,7 @@ unknown /dev/tty 4 1-63 console"#;
870870 #[ test]
871871 #[ cfg( target_os = "linux" ) ]
872872 fn test_walk_pid ( ) {
873- let find = walk_process ( ) . find ( |it| it. pid == getpid ( ) as usize ) ;
873+ let find = walk_process ( ) . find ( |it| it. pid == getpid ( ) . as_raw_pid ( ) as usize ) ;
874874
875875 assert ! ( find. is_some( ) ) ;
876876 }
@@ -963,10 +963,16 @@ unknown /dev/tty 4 1-63 console"#;
963963 #[ cfg( target_os = "linux" ) ]
964964 fn test_uid_gid ( ) {
965965 let mut pid_entry = ProcessInformation :: current_process_info ( ) . unwrap ( ) ;
966- assert_eq ! ( pid_entry. uid( ) . unwrap( ) , uucore:: process:: getuid( ) ) ;
967- assert_eq ! ( pid_entry. euid( ) . unwrap( ) , uucore:: process:: geteuid( ) ) ;
968- assert_eq ! ( pid_entry. gid( ) . unwrap( ) , uucore:: process:: getgid( ) ) ;
969- assert_eq ! ( pid_entry. egid( ) . unwrap( ) , uucore:: process:: getegid( ) ) ;
966+ assert_eq ! ( pid_entry. uid( ) . unwrap( ) , rustix:: process:: getuid( ) . as_raw( ) ) ;
967+ assert_eq ! (
968+ pid_entry. euid( ) . unwrap( ) ,
969+ rustix:: process:: geteuid( ) . as_raw( )
970+ ) ;
971+ assert_eq ! ( pid_entry. gid( ) . unwrap( ) , rustix:: process:: getgid( ) . as_raw( ) ) ;
972+ assert_eq ! (
973+ pid_entry. egid( ) . unwrap( ) ,
974+ rustix:: process:: getegid( ) . as_raw( )
975+ ) ;
970976 }
971977
972978 #[ test]
0 commit comments