1
+ use exit_status;
2
+ use NET_MAC_AWARE ;
3
+ use NET_MAC_AWARE_INHERIT ;
4
+ use PRIV_AWARE_RESET ;
5
+ use PRIV_DEBUG ;
6
+ use PRIV_PFEXEC ;
7
+ use PRIV_XPOLICY ;
8
+
9
+ pub type lgrp_rsrc_t = :: c_int ;
10
+ pub type lgrp_affinity_t = :: c_int ;
11
+
1
12
s ! {
2
13
pub struct shmid_ds {
3
14
pub shm_perm: :: ipc_perm,
21
32
}
22
33
}
23
34
35
+ s_no_extra_traits ! {
36
+ #[ cfg_attr( any(
37
+ target_arch = "x86" , target_arch = "x86_64" ) ,
38
+ repr( packed( 4 ) )
39
+ ) ]
40
+ pub struct epoll_event {
41
+ pub events: u32 ,
42
+ pub u64 : u64 ,
43
+ }
44
+
45
+ pub struct utmpx {
46
+ pub ut_user: [ :: c_char; _UTX_USERSIZE] ,
47
+ pub ut_id: [ :: c_char; _UTX_IDSIZE] ,
48
+ pub ut_line: [ :: c_char; _UTX_LINESIZE] ,
49
+ pub ut_pid: :: pid_t,
50
+ pub ut_type: :: c_short,
51
+ pub ut_exit: exit_status,
52
+ pub ut_tv: :: timeval,
53
+ pub ut_session: :: c_int,
54
+ pub ut_pad: [ :: c_int; _UTX_PADSIZE] ,
55
+ pub ut_syslen: :: c_short,
56
+ pub ut_host: [ :: c_char; _UTX_HOSTSIZE] ,
57
+ }
58
+ }
59
+
60
+ cfg_if ! {
61
+ if #[ cfg( feature = "extra_traits" ) ] {
62
+ impl PartialEq for utmpx {
63
+ fn eq( & self , other: & utmpx) -> bool {
64
+ self . ut_type == other. ut_type
65
+ && self . ut_pid == other. ut_pid
66
+ && self . ut_user == other. ut_user
67
+ && self . ut_line == other. ut_line
68
+ && self . ut_id == other. ut_id
69
+ && self . ut_exit == other. ut_exit
70
+ && self . ut_session == other. ut_session
71
+ && self . ut_tv == other. ut_tv
72
+ && self . ut_syslen == other. ut_syslen
73
+ && self . ut_pad == other. ut_pad
74
+ && self
75
+ . ut_host
76
+ . iter( )
77
+ . zip( other. ut_host. iter( ) )
78
+ . all( |( a, b) | a == b)
79
+ }
80
+ }
81
+
82
+ impl Eq for utmpx { }
83
+
84
+ impl :: fmt:: Debug for utmpx {
85
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
86
+ f. debug_struct( "utmpx" )
87
+ . field( "ut_user" , & self . ut_user)
88
+ . field( "ut_id" , & self . ut_id)
89
+ . field( "ut_line" , & self . ut_line)
90
+ . field( "ut_pid" , & self . ut_pid)
91
+ . field( "ut_type" , & self . ut_type)
92
+ . field( "ut_exit" , & self . ut_exit)
93
+ . field( "ut_tv" , & self . ut_tv)
94
+ . field( "ut_session" , & self . ut_session)
95
+ . field( "ut_pad" , & self . ut_pad)
96
+ . field( "ut_syslen" , & self . ut_syslen)
97
+ . field( "ut_host" , &&self . ut_host[ ..] )
98
+ . finish( )
99
+ }
100
+ }
101
+
102
+ impl :: hash:: Hash for utmpx {
103
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
104
+ self . ut_user. hash( state) ;
105
+ self . ut_type. hash( state) ;
106
+ self . ut_pid. hash( state) ;
107
+ self . ut_line. hash( state) ;
108
+ self . ut_id. hash( state) ;
109
+ self . ut_host. hash( state) ;
110
+ self . ut_exit. hash( state) ;
111
+ self . ut_session. hash( state) ;
112
+ self . ut_tv. hash( state) ;
113
+ self . ut_syslen. hash( state) ;
114
+ self . ut_pad. hash( state) ;
115
+ }
116
+ }
117
+
118
+ impl PartialEq for epoll_event {
119
+ fn eq( & self , other: & epoll_event) -> bool {
120
+ self . events == other. events
121
+ && self . u64 == other. u64
122
+ }
123
+ }
124
+ impl Eq for epoll_event { }
125
+ impl :: fmt:: Debug for epoll_event {
126
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
127
+ let events = self . events;
128
+ let u64 = self . u64 ;
129
+ f. debug_struct( "epoll_event" )
130
+ . field( "events" , & events)
131
+ . field( "u64" , & u64 )
132
+ . finish( )
133
+ }
134
+ }
135
+ impl :: hash:: Hash for epoll_event {
136
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
137
+ let events = self . events;
138
+ let u64 = self . u64 ;
139
+ events. hash( state) ;
140
+ u64 . hash( state) ;
141
+ }
142
+ }
143
+ }
144
+ }
145
+
146
+ pub const _UTX_USERSIZE: usize = 32 ;
147
+ pub const _UTX_LINESIZE: usize = 32 ;
148
+ pub const _UTX_PADSIZE: usize = 5 ;
149
+ pub const _UTX_IDSIZE: usize = 4 ;
150
+ pub const _UTX_HOSTSIZE: usize = 257 ;
151
+
24
152
pub const AF_LOCAL : :: c_int = 1 ; // AF_UNIX
25
153
pub const AF_FILE : :: c_int = 1 ; // AF_UNIX
26
154
@@ -56,6 +184,69 @@ pub const SOL_FILTER: ::c_int = 0xfffc;
56
184
57
185
pub const MADV_PURGE : :: c_int = 9 ;
58
186
187
+ pub const SIGINFO : :: c_int = 41 ;
188
+
189
+ pub const O_DIRECT : :: c_int = 0x2000000 ;
190
+
191
+ pub const PBIND_HARD : :: processorid_t = -3 ;
192
+ pub const PBIND_SOFT : :: processorid_t = -4 ;
193
+
194
+ pub const PS_SYSTEM : :: c_int = 1 ;
195
+
196
+ pub const MAP_FILE : :: c_int = 0 ;
197
+
198
+ pub const MAP_32BIT : :: c_int = 0x80 ;
199
+
200
+ pub const AF_NCA : :: c_int = 28 ;
201
+
202
+ pub const PF_NCA : :: c_int = AF_NCA ;
203
+
204
+ pub const LOCK_SH : :: c_int = 1 ;
205
+ pub const LOCK_EX : :: c_int = 2 ;
206
+ pub const LOCK_NB : :: c_int = 4 ;
207
+ pub const LOCK_UN : :: c_int = 8 ;
208
+
209
+ pub const _PC_LAST: :: c_int = 101 ;
210
+
211
+ pub const VSTATUS : usize = 16 ;
212
+ pub const VERASE2 : usize = 17 ;
213
+
214
+ pub const EPOLLIN : :: c_int = 0x1 ;
215
+ pub const EPOLLPRI : :: c_int = 0x2 ;
216
+ pub const EPOLLOUT : :: c_int = 0x4 ;
217
+ pub const EPOLLRDNORM : :: c_int = 0x40 ;
218
+ pub const EPOLLRDBAND : :: c_int = 0x80 ;
219
+ pub const EPOLLWRNORM : :: c_int = 0x100 ;
220
+ pub const EPOLLWRBAND : :: c_int = 0x200 ;
221
+ pub const EPOLLMSG : :: c_int = 0x400 ;
222
+ pub const EPOLLERR : :: c_int = 0x8 ;
223
+ pub const EPOLLHUP : :: c_int = 0x10 ;
224
+ pub const EPOLLET : :: c_int = 0x80000000 ;
225
+ pub const EPOLLRDHUP : :: c_int = 0x2000 ;
226
+ pub const EPOLLONESHOT : :: c_int = 0x40000000 ;
227
+ pub const EPOLLWAKEUP : :: c_int = 0x20000000 ;
228
+ pub const EPOLLEXCLUSIVE : :: c_int = 0x10000000 ;
229
+ pub const EPOLL_CLOEXEC : :: c_int = 0x80000 ;
230
+ pub const EPOLL_CTL_ADD : :: c_int = 1 ;
231
+ pub const EPOLL_CTL_MOD : :: c_int = 3 ;
232
+ pub const EPOLL_CTL_DEL : :: c_int = 2 ;
233
+
234
+ pub const PRIV_USER : :: c_uint = PRIV_DEBUG
235
+ | NET_MAC_AWARE
236
+ | NET_MAC_AWARE_INHERIT
237
+ | PRIV_XPOLICY
238
+ | PRIV_AWARE_RESET
239
+ | PRIV_PFEXEC ;
240
+
241
+ pub const LGRP_RSRC_COUNT : :: lgrp_rsrc_t = 2 ;
242
+ pub const LGRP_RSRC_CPU : :: lgrp_rsrc_t = 0 ;
243
+ pub const LGRP_RSRC_MEM : :: lgrp_rsrc_t = 1 ;
244
+
245
+ pub const P_DISABLED : :: c_int = 0x008 ;
246
+
247
+ pub const AT_SUN_HWCAP2 : :: c_uint = 2023 ;
248
+ pub const AT_SUN_FPTYPE : :: c_uint = 2027 ;
249
+
59
250
pub const B1000000 : :: speed_t = 24 ;
60
251
pub const B1152000 : :: speed_t = 25 ;
61
252
pub const B1500000 : :: speed_t = 26 ;
@@ -71,6 +262,24 @@ pub const SI_ADDRESS_WIDTH: ::c_int = 520;
71
262
extern "C" {
72
263
pub fn eventfd ( init : :: c_uint , flags : :: c_int ) -> :: c_int ;
73
264
265
+ pub fn epoll_pwait (
266
+ epfd : :: c_int ,
267
+ events : * mut :: epoll_event ,
268
+ maxevents : :: c_int ,
269
+ timeout : :: c_int ,
270
+ sigmask : * const :: sigset_t ,
271
+ ) -> :: c_int ;
272
+ pub fn epoll_create ( size : :: c_int ) -> :: c_int ;
273
+ pub fn epoll_create1 ( flags : :: c_int ) -> :: c_int ;
274
+ pub fn epoll_wait (
275
+ epfd : :: c_int ,
276
+ events : * mut :: epoll_event ,
277
+ maxevents : :: c_int ,
278
+ timeout : :: c_int ,
279
+ ) -> :: c_int ;
280
+ pub fn epoll_ctl ( epfd : :: c_int , op : :: c_int , fd : :: c_int , event : * mut :: epoll_event )
281
+ -> :: c_int ;
282
+
74
283
pub fn mincore ( addr : :: caddr_t , len : :: size_t , vec : * mut :: c_char ) -> :: c_int ;
75
284
76
285
pub fn pset_bind_lwp (
@@ -100,4 +309,12 @@ extern "C" {
100
309
pub fn pwritev ( fd : :: c_int , iov : * const :: iovec , iovcnt : :: c_int , offset : :: off_t )
101
310
-> :: ssize_t ;
102
311
pub fn getpagesizes2 ( pagesize : * mut :: size_t , nelem : :: c_int ) -> :: c_int ;
312
+
313
+ pub fn strcasecmp_l ( s1 : * const :: c_char , s2 : * const :: c_char , loc : :: locale_t ) -> :: c_int ;
314
+ pub fn strncasecmp_l (
315
+ s1 : * const :: c_char ,
316
+ s2 : * const :: c_char ,
317
+ n : :: size_t ,
318
+ loc : :: locale_t ,
319
+ ) -> :: c_int ;
103
320
}
0 commit comments