@@ -236,20 +236,10 @@ 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: 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,
253243 }
254244
255245 pub struct jail {
@@ -1351,6 +1341,36 @@ s! {
13511341}
13521342
13531343s_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+
13541374 pub struct utmpx {
13551375 pub ut_type: :: c_short,
13561376 pub ut_tv: :: timeval,
@@ -1398,12 +1418,7 @@ s_no_extra_traits! {
13981418 pub sigev_notify: :: c_int,
13991419 pub sigev_signo: :: c_int,
14001420 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,
14071422 }
14081423
14091424 pub struct ptsstat {
@@ -1819,33 +1834,17 @@ cfg_if! {
18191834 }
18201835 }
18211836
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 { }
18311837 impl :: fmt:: Debug for sigevent {
18321838 fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
18331839 f. debug_struct( "sigevent" )
18341840 . field( "sigev_notify" , & self . sigev_notify)
18351841 . field( "sigev_signo" , & self . sigev_signo)
18361842 . 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.
18381845 . finish( )
18391846 }
18401847 }
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- }
18491848
18501849 impl PartialEq for ptsstat {
18511850 fn eq( & self , other: & ptsstat) -> bool {
0 commit comments