@@ -80,6 +80,33 @@ impl ::Clone for timezone {
80
80
}
81
81
82
82
s ! {
83
+ pub struct dirent_extra {
84
+ pub d_datalen: u16 ,
85
+ pub d_type: u16 ,
86
+ pub d_reserved: u32 ,
87
+ }
88
+
89
+ pub struct stat {
90
+ pub st_ino: :: ino_t,
91
+ pub st_size: :: off_t,
92
+ pub st_dev: :: dev_t,
93
+ pub st_rdev: :: dev_t,
94
+ pub st_uid: :: uid_t,
95
+ pub st_gid: :: gid_t,
96
+ pub __old_st_mtime: :: _Time32t,
97
+ pub __old_st_atime: :: _Time32t,
98
+ pub __old_st_ctime: :: _Time32t,
99
+ pub st_mode: :: mode_t,
100
+ pub st_nlink: :: nlink_t,
101
+ pub st_blocksize: :: blksize_t,
102
+ pub st_nblocks: i32 ,
103
+ pub st_blksize: :: blksize_t,
104
+ pub st_blocks: :: blkcnt_t,
105
+ pub st_mtim: :: timespec,
106
+ pub st_atim: :: timespec,
107
+ pub st_ctim: :: timespec,
108
+ }
109
+
83
110
pub struct ip_mreq {
84
111
pub imr_multiaddr: in_addr,
85
112
pub imr_interface: in_addr,
@@ -641,7 +668,9 @@ s_no_extra_traits! {
641
668
642
669
pub struct sigevent {
643
670
pub sigev_notify: :: c_int,
644
- __sigev_un1: usize , // union
671
+ pub __padding1: :: c_int,
672
+ pub sigev_signo: :: c_int, // union
673
+ pub __padding2: :: c_int,
645
674
pub sigev_value: :: sigval,
646
675
__sigev_un2: usize , // union
647
676
@@ -654,33 +683,6 @@ s_no_extra_traits! {
654
683
pub d_name: [ :: c_char; 1 ] , // flex array
655
684
}
656
685
657
- pub struct dirent_extra {
658
- pub d_datalen: u16 ,
659
- pub d_type: u16 ,
660
- pub d_reserved: u32 ,
661
- }
662
-
663
- pub struct stat {
664
- pub st_ino: :: ino_t,
665
- pub st_size: :: off_t,
666
- pub st_dev: :: dev_t,
667
- pub st_rdev: :: dev_t,
668
- pub st_uid: :: uid_t,
669
- pub st_gid: :: gid_t,
670
- pub __old_st_mtime: :: _Time32t,
671
- pub __old_st_atime: :: _Time32t,
672
- pub __old_st_ctime: :: _Time32t,
673
- pub st_mode: :: mode_t,
674
- pub st_nlink: :: nlink_t,
675
- pub st_blocksize: :: blksize_t,
676
- pub st_nblocks: i32 ,
677
- pub st_blksize: :: blksize_t,
678
- pub st_blocks: :: blkcnt_t,
679
- pub st_mtim: :: timespec,
680
- pub st_atim: :: timespec,
681
- pub st_ctim: :: timespec,
682
- }
683
-
684
686
pub struct sigset_t {
685
687
__val: [ u32 ; 2 ] ,
686
688
}
@@ -756,6 +758,37 @@ s_no_extra_traits! {
756
758
757
759
cfg_if ! {
758
760
if #[ cfg( feature = "extra_traits" ) ] {
761
+ // sigevent
762
+ impl PartialEq for sigevent {
763
+ fn eq( & self , other: & sigevent) -> bool {
764
+ self . sigev_notify == other. sigev_notify
765
+ && self . sigev_signo == other. sigev_signo
766
+ && self . sigev_value == other. sigev_value
767
+ && self . __sigev_un2
768
+ == other. __sigev_un2
769
+ }
770
+ }
771
+ impl Eq for sigevent { }
772
+ impl :: fmt:: Debug for sigevent {
773
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
774
+ f. debug_struct( "sigevent" )
775
+ . field( "sigev_notify" , & self . sigev_notify)
776
+ . field( "sigev_signo" , & self . sigev_signo)
777
+ . field( "sigev_value" , & self . sigev_value)
778
+ . field( "__sigev_un2" ,
779
+ & self . __sigev_un2)
780
+ . finish( )
781
+ }
782
+ }
783
+ impl :: hash:: Hash for sigevent {
784
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
785
+ self . sigev_notify. hash( state) ;
786
+ self . sigev_signo. hash( state) ;
787
+ self . sigev_value. hash( state) ;
788
+ self . __sigev_un2. hash( state) ;
789
+ }
790
+ }
791
+
759
792
impl PartialEq for sockaddr_un {
760
793
fn eq( & self , other: & sockaddr_un) -> bool {
761
794
self . sun_len == other. sun_len
@@ -767,9 +800,7 @@ cfg_if! {
767
800
. all( |( a, b) | a == b)
768
801
}
769
802
}
770
-
771
803
impl Eq for sockaddr_un { }
772
-
773
804
impl :: fmt:: Debug for sockaddr_un {
774
805
fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
775
806
f. debug_struct( "sockaddr_un" )
@@ -788,6 +819,168 @@ cfg_if! {
788
819
}
789
820
}
790
821
822
+ // sigset_t
823
+ impl PartialEq for sigset_t {
824
+ fn eq( & self , other: & sigset_t) -> bool {
825
+ self . __val == other. __val
826
+ }
827
+ }
828
+ impl Eq for sigset_t { }
829
+ impl :: fmt:: Debug for sigset_t {
830
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
831
+ f. debug_struct( "sigset_t" )
832
+ . field( "__val" , & self . __val)
833
+ . finish( )
834
+ }
835
+ }
836
+ impl :: hash:: Hash for sigset_t {
837
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
838
+ self . __val. hash( state) ;
839
+ }
840
+ }
841
+
842
+ // msg
843
+ impl :: fmt:: Debug for msg {
844
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
845
+ f. debug_struct( "msg" )
846
+ . field( "msg_next" , & self . msg_next)
847
+ . field( "msg_type" , & self . msg_type)
848
+ . field( "msg_ts" , & self . msg_ts)
849
+ . field( "msg_spot" , & self . msg_spot)
850
+ . finish( )
851
+ }
852
+ }
853
+
854
+ // msqid_ds
855
+ impl :: fmt:: Debug for msqid_ds {
856
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
857
+ f. debug_struct( "msqid_ds" )
858
+ . field( "msg_perm" , & self . msg_perm)
859
+ . field( "msg_first" , & self . msg_first)
860
+ . field( "msg_cbytes" , & self . msg_cbytes)
861
+ . field( "msg_qnum" , & self . msg_qnum)
862
+ . field( "msg_qbytes" , & self . msg_qbytes)
863
+ . field( "msg_lspid" , & self . msg_lspid)
864
+ . field( "msg_lrpid" , & self . msg_lrpid)
865
+ . field( "msg_stime" , & self . msg_stime)
866
+ . field( "msg_rtime" , & self . msg_rtime)
867
+ . field( "msg_ctime" , & self . msg_ctime)
868
+ . finish( )
869
+ }
870
+ }
871
+
872
+ // sockaddr_dl
873
+ impl :: fmt:: Debug for sockaddr_dl {
874
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
875
+ f. debug_struct( "sockaddr_dl" )
876
+ . field( "sdl_len" , & self . sdl_len)
877
+ . field( "sdl_family" , & self . sdl_family)
878
+ . field( "sdl_index" , & self . sdl_index)
879
+ . field( "sdl_type" , & self . sdl_type)
880
+ . field( "sdl_nlen" , & self . sdl_nlen)
881
+ . field( "sdl_alen" , & self . sdl_alen)
882
+ . field( "sdl_slen" , & self . sdl_slen)
883
+ . field( "sdl_data" , & self . sdl_data)
884
+ . finish( )
885
+ }
886
+ }
887
+ impl PartialEq for sockaddr_dl {
888
+ fn eq( & self , other: & sockaddr_dl) -> bool {
889
+ self . sdl_len == other. sdl_len
890
+ && self . sdl_family == other. sdl_family
891
+ && self . sdl_index == other. sdl_index
892
+ && self . sdl_type == other. sdl_type
893
+ && self . sdl_nlen == other. sdl_nlen
894
+ && self . sdl_alen == other. sdl_alen
895
+ && self . sdl_slen == other. sdl_slen
896
+ && self
897
+ . sdl_data
898
+ . iter( )
899
+ . zip( other. sdl_data. iter( ) )
900
+ . all( |( a, b) | a == b)
901
+ }
902
+ }
903
+ impl Eq for sockaddr_dl { }
904
+ impl :: hash:: Hash for sockaddr_dl {
905
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
906
+ self . sdl_len. hash( state) ;
907
+ self . sdl_family. hash( state) ;
908
+ self . sdl_index. hash( state) ;
909
+ self . sdl_type. hash( state) ;
910
+ self . sdl_nlen. hash( state) ;
911
+ self . sdl_alen. hash( state) ;
912
+ self . sdl_slen. hash( state) ;
913
+ self . sdl_data. hash( state) ;
914
+ }
915
+ }
916
+
917
+ // sync_t
918
+ impl :: fmt:: Debug for sync_t {
919
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
920
+ f. debug_struct( "sync_t" )
921
+ . field( "__owner" , & self . __owner)
922
+ . field( "__u" , & self . __u)
923
+ . finish( )
924
+ }
925
+ }
926
+
927
+ // pthread_barrier_t
928
+ impl :: fmt:: Debug for pthread_barrier_t {
929
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
930
+ f. debug_struct( "pthread_barrier_t" )
931
+ . field( "__pad" , & self . __pad)
932
+ . finish( )
933
+ }
934
+ }
935
+
936
+ // pthread_rwlock_t
937
+ impl :: fmt:: Debug for pthread_rwlock_t {
938
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
939
+ f. debug_struct( "pthread_rwlock_t" )
940
+ . field( "__active" , & self . __active)
941
+ . field( "__blockedwriters" , & self . __blockedwriters)
942
+ . field( "__blockedreaders" , & self . __blockedreaders)
943
+ . field( "__heavy" , & self . __heavy)
944
+ . field( "__lock" , & self . __lock)
945
+ . field( "__rcond" , & self . __rcond)
946
+ . field( "__wcond" , & self . __wcond)
947
+ . field( "__owner" , & self . __owner)
948
+ . field( "__spare" , & self . __spare)
949
+ . finish( )
950
+ }
951
+ }
952
+
953
+ // syspage_entry
954
+ impl :: fmt:: Debug for syspage_entry {
955
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
956
+ f. debug_struct( "syspage_entry" )
957
+ . field( "size" , & self . size)
958
+ . field( "total_size" , & self . total_size)
959
+ . field( "type_" , & self . type_)
960
+ . field( "num_cpu" , & self . num_cpu)
961
+ . field( "system_private" , & self . system_private)
962
+ . field( "old_asinfo" , & self . old_asinfo)
963
+ . field( "hwinfo" , & self . hwinfo)
964
+ . field( "old_cpuinfo" , & self . old_cpuinfo)
965
+ . field( "old_cacheattr" , & self . old_cacheattr)
966
+ . field( "qtime" , & self . qtime)
967
+ . field( "callout" , & self . callout)
968
+ . field( "callin" , & self . callin)
969
+ . field( "typed_strings" , & self . typed_strings)
970
+ . field( "strings" , & self . strings)
971
+ . field( "old_intrinfo" , & self . old_intrinfo)
972
+ . field( "smp" , & self . smp)
973
+ . field( "pminfo" , & self . pminfo)
974
+ . field( "old_mdriver" , & self . old_mdriver)
975
+ . field( "new_asinfo" , & self . new_asinfo)
976
+ . field( "new_cpuinfo" , & self . new_cpuinfo)
977
+ . field( "new_cacheattr" , & self . new_cacheattr)
978
+ . field( "new_intrinfo" , & self . new_intrinfo)
979
+ . field( "new_mdriver" , & self . new_mdriver)
980
+ . finish( )
981
+ }
982
+ }
983
+
791
984
impl PartialEq for utsname {
792
985
fn eq( & self , other: & utsname) -> bool {
793
986
self . sysname
@@ -868,6 +1061,16 @@ cfg_if! {
868
1061
. finish( )
869
1062
}
870
1063
}
1064
+ impl :: hash:: Hash for mq_attr {
1065
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1066
+ self . mq_maxmsg. hash( state) ;
1067
+ self . mq_msgsize. hash( state) ;
1068
+ self . mq_flags. hash( state) ;
1069
+ self . mq_curmsgs. hash( state) ;
1070
+ self . mq_sendwait. hash( state) ;
1071
+ self . mq_recvwait. hash( state) ;
1072
+ }
1073
+ }
871
1074
872
1075
impl PartialEq for sockaddr_storage {
873
1076
fn eq( & self , other: & sockaddr_storage) -> bool {
@@ -2606,6 +2809,14 @@ f! {
2606
2809
} ;
2607
2810
:: mem:: size_of:: <sockcred>( ) + :: mem:: size_of:: <:: gid_t>( ) * ngrps
2608
2811
}
2812
+
2813
+ pub fn major( dev: :: dev_t) -> :: c_uint {
2814
+ ( ( dev as :: c_uint) >> 10 ) & 0x3f
2815
+ }
2816
+
2817
+ pub fn minor( dev: :: dev_t) -> :: c_uint {
2818
+ ( dev as :: c_uint) & 0x3ff
2819
+ }
2609
2820
}
2610
2821
2611
2822
safe_f ! {
@@ -2644,6 +2855,10 @@ safe_f! {
2644
2855
pub { const } fn IPTOS_ECN ( x: u8 ) -> u8 {
2645
2856
x & :: IPTOS_ECN_MASK
2646
2857
}
2858
+
2859
+ pub { const } fn makedev( major: :: c_uint, minor: :: c_uint) -> :: dev_t {
2860
+ ( ( major << 10 ) | ( minor) ) as :: dev_t
2861
+ }
2647
2862
}
2648
2863
2649
2864
// Network related functions are provided by libsocket and regex
@@ -2658,6 +2873,12 @@ extern "C" {
2658
2873
pub fn getpriority ( which : :: c_int , who : :: id_t ) -> :: c_int ;
2659
2874
pub fn setpriority ( which : :: c_int , who : :: id_t , prio : :: c_int ) -> :: c_int ;
2660
2875
pub fn mkfifoat ( dirfd : :: c_int , pathname : * const :: c_char , mode : :: mode_t ) -> :: c_int ;
2876
+ pub fn mknodat (
2877
+ __fd : :: c_int ,
2878
+ pathname : * const :: c_char ,
2879
+ mode : :: mode_t ,
2880
+ dev : :: dev_t ,
2881
+ ) -> :: c_int ;
2661
2882
2662
2883
pub fn clock_getres ( clk_id : :: clockid_t , tp : * mut :: timespec ) -> :: c_int ;
2663
2884
pub fn clock_gettime ( clk_id : :: clockid_t , tp : * mut :: timespec ) -> :: c_int ;
0 commit comments