Skip to content

Commit 8107ff7

Browse files
committed
Fixup: respond to feedback from @tgross35
1 parent e3b96ef commit 8107ff7

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

libc-test/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2674,7 +2674,7 @@ fn test_freebsd(target: &str) {
26742674
cfg.volatile_item(|i| {
26752675
use ctest::VolatileItemKind::*;
26762676
match i {
2677-
// aio_buf is a volatile void** but since we cannot express that in
2677+
// aio_buf is a volatile void* but since we cannot express that in
26782678
// Rust types, we have to explicitly tell the checker about it here:
26792679
StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => true,
26802680
_ => false,

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ impl ::Clone for devstat_select_mode {
237237

238238
s! {
239239
pub struct __c_anonymous_sigev_thread {
240-
pub _function: *mut ::c_void, // Actually a function pointer
240+
pub _function: Option<extern "C" fn(::sigval) -> *mut ::c_void>,
241+
//pub _function: *mut ::c_void, // Actually a function pointer
241242
pub _attribute: *mut ::pthread_attr_t,
242243
}
243244

@@ -1340,20 +1341,24 @@ s! {
13401341
}
13411342

13421343
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+
13431351
#[cfg_attr(feature = "extra_traits", derive(Debug))]
13441352
pub struct aiocb {
13451353
pub aio_fildes: ::c_int,
13461354
pub aio_offset: ::off_t,
13471355
pub aio_buf: *mut ::c_void,
13481356
pub aio_nbytes: ::size_t,
1349-
__unused1: [::c_int; 2],
1350-
__unused2: *mut ::c_void,
1357+
__spare__: [::c_int; 2],
1358+
__spare2__: *mut ::c_void,
13511359
pub aio_lio_opcode: ::c_int,
13521360
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,
1361+
_aiocb_private: __aiocb_private,
13571362
pub aio_sigevent: sigevent,
13581363
}
13591364

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,9 +506,10 @@ s_no_extra_traits! {
506506
__policy: ::c_int,
507507
__error_code: ::c_int,
508508
__return_value: ::ssize_t,
509+
// FIXME(off64): visible fields depend on __USE_FILE_OFFSET64
509510
pub aio_offset: off_t,
510511
#[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))]
511-
__unused1: [::c_char; 4],
512+
__pad: [::c_char; 4],
512513
__glibc_reserved: [::c_char; 32],
513514
}
514515
}

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ s_no_extra_traits! {
414414
pub aio_offset: off_t,
415415
__next: *mut ::c_void,
416416
__prev: *mut ::c_void,
417+
// FIXME(ctest): length should be `32 - 2 * core::mem::size_of::<*const ()>()`
417418
#[cfg(target_pointer_width = "32")]
418419
__dummy4: [::c_char; 24],
419420
#[cfg(target_pointer_width = "64")]

src/unix/linux_like/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ missing! {
1313

1414
s! {
1515
pub struct __c_anonymous_sigev_thread {
16-
pub _function: *mut ::c_void, // Actually a function pointer
16+
pub _function: Option<extern "C" fn(::sigval) -> *mut ::c_void>,
1717
pub _attribute: *mut ::pthread_attr_t,
1818
}
1919

0 commit comments

Comments
 (0)