@@ -236,20 +236,10 @@ impl ::Clone for devstat_select_mode {
236
236
}
237
237
238
238
s ! {
239
- pub struct aiocb {
240
- pub aio_fildes: :: c_int,
241
- pub aio_offset: :: off_t,
242
- pub aio_buf: * mut :: c_void,
243
- pub aio_nbytes: :: size_t,
244
- __unused1: [ :: c_int; 2 ] ,
245
- __unused2: * mut :: c_void,
246
- pub aio_lio_opcode: :: c_int,
247
- pub aio_reqprio: :: c_int,
248
- // unused 3 through 5 are the __aiocb_private structure
249
- __unused3: :: c_long,
250
- __unused4: :: c_long,
251
- __unused5: * mut :: c_void,
252
- pub aio_sigevent: sigevent,
239
+ pub struct __c_anonymous_sigev_thread {
240
+ pub _function: Option <extern "C" fn ( :: sigval) -> * mut :: c_void>,
241
+ //pub _function: *mut ::c_void, // Actually a function pointer
242
+ pub _attribute: * mut :: pthread_attr_t,
253
243
}
254
244
255
245
pub struct jail {
@@ -1351,6 +1341,36 @@ s! {
1351
1341
}
1352
1342
1353
1343
s_no_extra_traits ! {
1344
+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
1345
+ pub struct __aiocb_private {
1346
+ status: :: c_long,
1347
+ error: :: c_long,
1348
+ spare: * mut :: c_void,
1349
+ }
1350
+
1351
+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
1352
+ pub struct aiocb {
1353
+ pub aio_fildes: :: c_int,
1354
+ pub aio_offset: :: off_t,
1355
+ pub aio_buf: * mut :: c_void,
1356
+ pub aio_nbytes: :: size_t,
1357
+ __spare__: [ :: c_int; 2 ] ,
1358
+ __spare2__: * mut :: c_void,
1359
+ pub aio_lio_opcode: :: c_int,
1360
+ pub aio_reqprio: :: c_int,
1361
+ _aiocb_private: __aiocb_private,
1362
+ pub aio_sigevent: sigevent,
1363
+ }
1364
+
1365
+ // Can't correctly impl Debug for unions
1366
+ #[ allow( missing_debug_implementations) ]
1367
+ pub union __c_anonymous_sigev_un {
1368
+ pub _threadid: :: __lwpid_t,
1369
+ pub _sigev_thread: __c_anonymous_sigev_thread,
1370
+ pub _kevent_flags: :: c_ushort,
1371
+ __spare__: [ :: c_long; 8 ] ,
1372
+ }
1373
+
1354
1374
pub struct utmpx {
1355
1375
pub ut_type: :: c_short,
1356
1376
pub ut_tv: :: timeval,
@@ -1398,12 +1418,7 @@ s_no_extra_traits! {
1398
1418
pub sigev_notify: :: c_int,
1399
1419
pub sigev_signo: :: c_int,
1400
1420
pub sigev_value: :: sigval,
1401
- //The rest of the structure is actually a union. We expose only
1402
- //sigev_notify_thread_id because it's the most useful union member.
1403
- pub sigev_notify_thread_id: :: lwpid_t,
1404
- #[ cfg( target_pointer_width = "64" ) ]
1405
- __unused1: :: c_int,
1406
- __unused2: [ :: c_long; 7 ] ,
1421
+ pub _sigev_un: __c_anonymous_sigev_un,
1407
1422
}
1408
1423
1409
1424
pub struct ptsstat {
@@ -1819,33 +1834,17 @@ cfg_if! {
1819
1834
}
1820
1835
}
1821
1836
1822
- impl PartialEq for sigevent {
1823
- fn eq( & self , other: & sigevent) -> bool {
1824
- self . sigev_notify == other. sigev_notify
1825
- && self . sigev_signo == other. sigev_signo
1826
- && self . sigev_value == other. sigev_value
1827
- && self . sigev_notify_thread_id == other. sigev_notify_thread_id
1828
- }
1829
- }
1830
- impl Eq for sigevent { }
1831
1837
impl :: fmt:: Debug for sigevent {
1832
1838
fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1833
1839
f. debug_struct( "sigevent" )
1834
1840
. field( "sigev_notify" , & self . sigev_notify)
1835
1841
. field( "sigev_signo" , & self . sigev_signo)
1836
1842
. field( "sigev_value" , & self . sigev_value)
1837
- . field( "sigev_notify_thread_id" , & self . sigev_notify_thread_id)
1843
+ // Skip _sigev_un, since we can't guarantee that it will be
1844
+ // properly initialized.
1838
1845
. finish( )
1839
1846
}
1840
1847
}
1841
- impl :: hash:: Hash for sigevent {
1842
- fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1843
- self . sigev_notify. hash( state) ;
1844
- self . sigev_signo. hash( state) ;
1845
- self . sigev_value. hash( state) ;
1846
- self . sigev_notify_thread_id. hash( state) ;
1847
- }
1848
- }
1849
1848
1850
1849
impl PartialEq for ptsstat {
1851
1850
fn eq( & self , other: & ptsstat) -> bool {
0 commit comments