File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,41 @@ pub mod cmsg_macros {
131
131
}
132
132
}
133
133
134
+ #[ cfg( feature = "general" ) ]
135
+ pub mod select_macros {
136
+ use crate :: ctypes:: c_int;
137
+ use crate :: general:: __kernel_fd_set;
138
+ use core:: mem:: size_of;
139
+
140
+ pub unsafe fn FD_CLR ( fd : c_int , set : * mut __kernel_fd_set ) {
141
+ let bytes = set as * mut u8 ;
142
+ if fd >= 0 {
143
+ * bytes. offset ( ( fd / 8 ) as isize ) &= !( 1 << ( fd % 8 ) ) ;
144
+ }
145
+ }
146
+
147
+ pub unsafe fn FD_SET ( fd : c_int , set : * mut __kernel_fd_set ) {
148
+ let bytes = set as * mut u8 ;
149
+ if fd >= 0 {
150
+ * bytes. offset ( ( fd / 8 ) as isize ) |= 1 << ( fd % 8 ) ;
151
+ }
152
+ }
153
+
154
+ pub unsafe fn FD_ISSET ( fd : c_int , set : * const __kernel_fd_set ) -> bool {
155
+ let bytes = set as * const u8 ;
156
+ if fd >= 0 {
157
+ * bytes. offset ( ( fd / 8 ) as isize ) & ( 1 << ( fd % 8 ) ) != 0
158
+ } else {
159
+ false
160
+ }
161
+ }
162
+
163
+ pub unsafe fn FD_ZERO ( set : * mut __kernel_fd_set ) {
164
+ let bytes = set as * mut u8 ;
165
+ core:: ptr:: write_bytes ( bytes, 0 , size_of :: < __kernel_fd_set > ( ) ) ;
166
+ }
167
+ }
168
+
134
169
// The rest of this file is auto-generated!
135
170
#[ cfg( feature = "errno" ) ]
136
171
#[ cfg( target_arch = "arm" ) ]
You can’t perform that action at this time.
0 commit comments