@@ -422,6 +422,12 @@ s_no_extra_traits! {
422
422
pub ivlen: u32 ,
423
423
pub iv: [ :: c_uchar; 0 ] ,
424
424
}
425
+
426
+ pub struct prop_info {
427
+ __name: [ :: c_char; 32 ] ,
428
+ __serial: :: c_uint,
429
+ __value: [ [ :: c_char; 4 ] ; 23 ] ,
430
+ }
425
431
}
426
432
427
433
cfg_if ! {
@@ -740,6 +746,24 @@ cfg_if! {
740
746
self . as_slice( ) . hash( state) ;
741
747
}
742
748
}
749
+
750
+ impl PartialEq for prop_info {
751
+ fn eq( & self , other: & prop_info) -> bool {
752
+ self . __name == other. __name &&
753
+ self . __serial == other. __serial &&
754
+ self . __value == other. __value
755
+ }
756
+ }
757
+ impl Eq for prop_info { }
758
+ impl :: fmt:: Debug for prop_info {
759
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
760
+ f. debug_struct( "prop_info" )
761
+ . field( "__name" , & self . __name)
762
+ . field( "__serial" , & self . __serial)
763
+ . field( "__value" , & self . __value)
764
+ . finish( )
765
+ }
766
+ }
743
767
}
744
768
}
745
769
@@ -2412,6 +2436,7 @@ pub const PF_VSOCK: ::c_int = AF_VSOCK;
2412
2436
2413
2437
// sys/system_properties.h
2414
2438
pub const PROP_VALUE_MAX : :: c_int = 92 ;
2439
+ pub const PROP_NAME_MAX : :: c_int = 32 ;
2415
2440
2416
2441
f ! {
2417
2442
pub fn CMSG_NXTHDR ( mhdr: * const msghdr,
@@ -2864,6 +2889,12 @@ extern "C" {
2864
2889
2865
2890
pub fn __system_property_set ( __name : * const :: c_char , __value : * const :: c_char ) -> :: c_int ;
2866
2891
pub fn __system_property_get ( __name : * const :: c_char , __value : * mut :: c_char ) -> :: c_int ;
2892
+ pub fn __system_property_find ( __name : * const :: c_char ) -> * const prop_info ;
2893
+ pub fn __system_property_find_nth ( __n : :: c_uint ) -> * const prop_info ;
2894
+ pub fn __system_property_foreach (
2895
+ __callback : unsafe extern "C" fn ( __pi : * const prop_info , __cookie : * mut :: c_void ) ,
2896
+ __cookie : * mut :: c_void ,
2897
+ ) -> :: c_int ;
2867
2898
2868
2899
// #include <link.h>
2869
2900
/// Only available in API Version 21+
0 commit comments