@@ -236,20 +236,9 @@ impl ::Clone for devstat_select_mode {
236236}
237237
238238s ! {
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: * mut :: c_void, // Actually a function pointer
241+ pub _attribute: * mut :: pthread_attr_t,
253242 }
254243
255244 pub struct jail {
@@ -1351,6 +1340,32 @@ s! {
13511340}
13521341
13531342s_no_extra_traits ! {
1343+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
1344+ pub struct aiocb {
1345+ pub aio_fildes: :: c_int,
1346+ pub aio_offset: :: off_t,
1347+ pub aio_buf: * mut :: c_void,
1348+ pub aio_nbytes: :: size_t,
1349+ __unused1: [ :: c_int; 2 ] ,
1350+ __unused2: * mut :: c_void,
1351+ pub aio_lio_opcode: :: c_int,
1352+ pub aio_reqprio: :: c_int,
1353+ // unused 3 through 5 are the __aiocb_private structure
1354+ __unused3: :: c_long,
1355+ __unused4: :: c_long,
1356+ __unused5: * mut :: c_void,
1357+ pub aio_sigevent: sigevent,
1358+ }
1359+
1360+ // Can't correctly impl Debug for unions
1361+ #[ allow( missing_debug_implementations) ]
1362+ pub union __c_anonymous_sigev_un {
1363+ pub _threadid: :: __lwpid_t,
1364+ pub _sigev_thread: __c_anonymous_sigev_thread,
1365+ pub _kevent_flags: :: c_ushort,
1366+ __spare__: [ :: c_long; 8 ] ,
1367+ }
1368+
13541369 pub struct utmpx {
13551370 pub ut_type: :: c_short,
13561371 pub ut_tv: :: timeval,
@@ -1398,12 +1413,7 @@ s_no_extra_traits! {
13981413 pub sigev_notify: :: c_int,
13991414 pub sigev_signo: :: c_int,
14001415 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 ] ,
1416+ pub _sigev_un: __c_anonymous_sigev_un,
14071417 }
14081418
14091419 pub struct ptsstat {
@@ -1819,33 +1829,17 @@ cfg_if! {
18191829 }
18201830 }
18211831
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 { }
18311832 impl :: fmt:: Debug for sigevent {
18321833 fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
18331834 f. debug_struct( "sigevent" )
18341835 . field( "sigev_notify" , & self . sigev_notify)
18351836 . field( "sigev_signo" , & self . sigev_signo)
18361837 . field( "sigev_value" , & self . sigev_value)
1837- . field( "sigev_notify_thread_id" , & self . sigev_notify_thread_id)
1838+ // Skip _sigev_un, since we can't guarantee that it will be
1839+ // properly initialized.
18381840 . finish( )
18391841 }
18401842 }
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- }
18491843
18501844 impl PartialEq for ptsstat {
18511845 fn eq( & self , other: & ptsstat) -> bool {
0 commit comments