File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ cfg_if::cfg_if! {
3535 target_os = "freebsd" ,
3636 target_os = "fuchsia" ,
3737 target_os = "haiku" ,
38+ target_os = "hurd" ,
3839 target_os = "ios" ,
3940 target_os = "linux" ,
4041 target_os = "macos" ,
@@ -231,6 +232,7 @@ cfg_if::cfg_if! {
231232 target_os = "linux" ,
232233 target_os = "fuchsia" ,
233234 target_os = "freebsd" ,
235+ target_os = "hurd" ,
234236 target_os = "openbsd" ,
235237 target_os = "netbsd" ,
236238 all( target_os = "android" , feature = "dl_iterate_phdr" ) ,
Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ const DEBUG_PATH: &[u8] = b"/usr/lib/debug";
308308
309309fn debug_path_exists ( ) -> bool {
310310 cfg_if:: cfg_if! {
311- if #[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ] {
311+ if #[ cfg( any( target_os = "freebsd" , target_os = "hurd" , target_os = " linux") ) ] {
312312 use core:: sync:: atomic:: { AtomicU8 , Ordering } ;
313313 static DEBUG_PATH_EXISTS : AtomicU8 = AtomicU8 :: new( 0 ) ;
314314
Original file line number Diff line number Diff line change @@ -18,14 +18,18 @@ pub(super) fn native_libraries() -> Vec<Library> {
1818}
1919
2020fn infer_current_exe ( base_addr : usize ) -> OsString {
21- if let Ok ( entries) = super :: parse_running_mmaps:: parse_maps ( ) {
22- let opt_path = entries
23- . iter ( )
24- . find ( |e| e. ip_matches ( base_addr) && e. pathname ( ) . len ( ) > 0 )
25- . map ( |e| e. pathname ( ) )
26- . cloned ( ) ;
27- if let Some ( path) = opt_path {
28- return path;
21+ cfg_if:: cfg_if! {
22+ if #[ cfg( not( target_os = "hurd" ) ) ] {
23+ if let Ok ( entries) = super :: parse_running_mmaps:: parse_maps( ) {
24+ let opt_path = entries
25+ . iter( )
26+ . find( |e| e. ip_matches( base_addr) && e. pathname( ) . len( ) > 0 )
27+ . map( |e| e. pathname( ) )
28+ . cloned( ) ;
29+ if let Some ( path) = opt_path {
30+ return path;
31+ }
32+ }
2933 }
3034 }
3135 env:: current_exe ( ) . map ( |e| e. into ( ) ) . unwrap_or_default ( )
You can’t perform that action at this time.
0 commit comments