@@ -237,20 +237,9 @@ impl ::Clone for devstat_select_mode {
237237}
238238
239239s ! {
240- pub struct aiocb {
241- pub aio_fildes: :: c_int,
242- pub aio_offset: :: off_t,
243- pub aio_buf: * mut :: c_void,
244- pub aio_nbytes: :: size_t,
245- __unused1: [ :: c_int; 2 ] ,
246- __unused2: * mut :: c_void,
247- pub aio_lio_opcode: :: c_int,
248- pub aio_reqprio: :: c_int,
249- // unused 3 through 5 are the __aiocb_private structure
250- __unused3: :: c_long,
251- __unused4: :: c_long,
252- __unused5: * mut :: c_void,
253- pub aio_sigevent: sigevent
240+ pub struct __c_anonymous_sigev_thread {
241+ pub _function: * mut :: c_void, // Actually a function pointer
242+ pub _attribute: * mut :: pthread_attr_t,
254243 }
255244
256245 pub struct jail {
@@ -1353,6 +1342,32 @@ s! {
13531342}
13541343
13551344s_no_extra_traits ! {
1345+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
1346+ pub struct aiocb {
1347+ pub aio_fildes: :: c_int,
1348+ pub aio_offset: :: off_t,
1349+ pub aio_buf: * mut :: c_void,
1350+ pub aio_nbytes: :: size_t,
1351+ __unused1: [ :: c_int; 2 ] ,
1352+ __unused2: * mut :: c_void,
1353+ pub aio_lio_opcode: :: c_int,
1354+ pub aio_reqprio: :: c_int,
1355+ // unused 3 through 5 are the __aiocb_private structure
1356+ __unused3: :: c_long,
1357+ __unused4: :: c_long,
1358+ __unused5: * mut :: c_void,
1359+ pub aio_sigevent: sigevent
1360+ }
1361+
1362+ // Can't correctly impl Debug for unions
1363+ #[ allow( missing_debug_implementations) ]
1364+ pub union __c_anonymous_sigev_un {
1365+ pub _threadid: :: __lwpid_t,
1366+ pub _sigev_thread: __c_anonymous_sigev_thread,
1367+ pub _kevent_flags: :: c_ushort,
1368+ __spare__: [ :: c_long; 8 ] ,
1369+ }
1370+
13561371 pub struct utmpx {
13571372 pub ut_type: :: c_short,
13581373 pub ut_tv: :: timeval,
@@ -1400,12 +1415,7 @@ s_no_extra_traits! {
14001415 pub sigev_notify: :: c_int,
14011416 pub sigev_signo: :: c_int,
14021417 pub sigev_value: :: sigval,
1403- //The rest of the structure is actually a union. We expose only
1404- //sigev_notify_thread_id because it's the most useful union member.
1405- pub sigev_notify_thread_id: :: lwpid_t,
1406- #[ cfg( target_pointer_width = "64" ) ]
1407- __unused1: :: c_int,
1408- __unused2: [ :: c_long; 7 ]
1418+ pub _sigev_un: __c_anonymous_sigev_un,
14091419 }
14101420
14111421 pub struct ptsstat {
@@ -1799,35 +1809,17 @@ cfg_if! {
17991809 }
18001810 }
18011811
1802- impl PartialEq for sigevent {
1803- fn eq( & self , other: & sigevent) -> bool {
1804- self . sigev_notify == other. sigev_notify
1805- && self . sigev_signo == other. sigev_signo
1806- && self . sigev_value == other. sigev_value
1807- && self . sigev_notify_thread_id
1808- == other. sigev_notify_thread_id
1809- }
1810- }
1811- impl Eq for sigevent { }
18121812 impl :: fmt:: Debug for sigevent {
18131813 fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
18141814 f. debug_struct( "sigevent" )
18151815 . field( "sigev_notify" , & self . sigev_notify)
18161816 . field( "sigev_signo" , & self . sigev_signo)
18171817 . field( "sigev_value" , & self . sigev_value)
1818- . field ( "sigev_notify_thread_id" ,
1819- & self . sigev_notify_thread_id )
1818+ // Skip _sigev_un, since we can't guarantee that it will be
1819+ // properly initialized.
18201820 . finish( )
18211821 }
18221822 }
1823- impl :: hash:: Hash for sigevent {
1824- fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1825- self . sigev_notify. hash( state) ;
1826- self . sigev_signo. hash( state) ;
1827- self . sigev_value. hash( state) ;
1828- self . sigev_notify_thread_id. hash( state) ;
1829- }
1830- }
18311823
18321824 impl PartialEq for ptsstat {
18331825 fn eq( & self , other: & ptsstat) -> bool {
0 commit comments