File tree 1 file changed +9
-7
lines changed
library/std/src/sys/pal/unix
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,19 @@ mod imp {
62
62
unsafe { getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , libc:: GRND_NONBLOCK ) }
63
63
}
64
64
65
- #[ cfg( any(
66
- target_os = "espidf" ,
67
- target_os = "horizon" ,
68
- target_os = "freebsd" ,
69
- target_os = "dragonfly" ,
70
- netbsd10
71
- ) ) ]
65
+ #[ cfg( any( target_os = "espidf" , target_os = "horizon" , target_os = "freebsd" , netbsd10) ) ]
72
66
fn getrandom ( buf : & mut [ u8 ] ) -> libc:: ssize_t {
73
67
unsafe { libc:: getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , 0 ) }
74
68
}
75
69
70
+ #[ cfg( target_os = "dragonfly" ) ]
71
+ fn getrandom ( buf : & mut [ u8 ] ) -> libc:: ssize_t {
72
+ extern "C" {
73
+ fn getrandom ( buf : * mut c_void , buflen : size_t , flags : c_uint ) -> c_int ;
74
+ }
75
+ unsafe { getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , 0 ) }
76
+ }
77
+
76
78
#[ cfg( not( any(
77
79
target_os = "linux" ,
78
80
target_os = "android" ,
You can’t perform that action at this time.
0 commit comments