File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ fn main() {
77
77
cfg. header ( "netinet/in.h" ) ;
78
78
cfg. header ( "netinet/ip.h" ) ;
79
79
cfg. header ( "netinet/tcp.h" ) ;
80
+ cfg. header ( "resolv.h" ) ;
80
81
cfg. header ( "pthread.h" ) ;
81
82
cfg. header ( "dlfcn.h" ) ;
82
83
cfg. header ( "signal.h" ) ;
@@ -473,6 +474,16 @@ fn main() {
473
474
// it's in a header file?
474
475
"endpwent" if android => true ,
475
476
477
+ // Apparently res_init exists on Android, but isn't defined in a header:
478
+ // https://mail.gnome.org/archives/commits-list/2013-May/msg01329.html
479
+ "res_init" if android => true ,
480
+
481
+ // On macOS and iOS, res_init is available, but requires linking with libresolv:
482
+ // http://blog.achernya.com/2013/03/os-x-has-silly-libsystem.html
483
+ // See discussion for skipping here:
484
+ // https://github.com/rust-lang/libc/pull/585#discussion_r114561460
485
+ "res_init" if apple => true ,
486
+
476
487
_ => false ,
477
488
}
478
489
} ) ;
Original file line number Diff line number Diff line change @@ -694,6 +694,14 @@ extern {
694
694
res : * mut * mut addrinfo ) -> :: c_int ;
695
695
pub fn freeaddrinfo ( res : * mut addrinfo ) ;
696
696
pub fn gai_strerror ( errcode : :: c_int ) -> * const :: c_char ;
697
+ #[ cfg_attr( any(
698
+ all( target_os = "linux" , not( target_env = "musl" ) ) ,
699
+ target_os = "freebsd" ,
700
+ target_os = "dragonfly" ) ,
701
+ link_name = "__res_init" ) ]
702
+ #[ cfg_attr( any( target_os = "macos" , target_os = "ios" ) ,
703
+ link_name = "res_9_init" ) ]
704
+ pub fn res_init ( ) -> :: c_int ;
697
705
698
706
#[ cfg_attr( target_os = "netbsd" , link_name = "__gmtime_r50" ) ]
699
707
pub fn gmtime_r ( time_p : * const time_t , result : * mut tm ) -> * mut tm ;
You can’t perform that action at this time.
0 commit comments