File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -62,18 +62,15 @@ mod imp {
6262 unsafe { getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , libc:: GRND_NONBLOCK ) }
6363 }
6464
65- #[ cfg( any( target_os = "espidf" , target_os = "horizon" ) ) ]
65+ #[ cfg( any( target_os = "espidf" , target_os = "horizon" , target_os = "freebsd" ) ) ]
6666 fn getrandom ( buf : & mut [ u8 ] ) -> libc:: ssize_t {
67- unsafe { libc:: getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , 0 ) }
68- }
69-
70- #[ cfg( target_os = "freebsd" ) ]
71- fn getrandom ( buf : & mut [ u8 ] ) -> libc:: ssize_t {
72- // FIXME: using the above when libary std's libc is updated
67+ #[ cfg( not( target_os = "freebsd" ) ) ]
68+ use libc:: getrandom;
69+ #[ cfg( target_os = "freebsd" ) ]
7370 extern "C" {
7471 fn getrandom (
75- buffer : * mut libc:: c_void ,
76- length : libc:: size_t ,
72+ buf : * mut libc:: c_void ,
73+ buflen : libc:: size_t ,
7774 flags : libc:: c_uint ,
7875 ) -> libc:: ssize_t ;
7976 }
@@ -236,6 +233,7 @@ mod imp {
236233 }
237234}
238235
236+ // FIXME: once the 10.x release becomes the minimum, this can be dropped for simplification.
239237#[ cfg( target_os = "netbsd" ) ]
240238mod imp {
241239 use crate :: ptr;
You can’t perform that action at this time.
0 commit comments