Skip to content

Commit 55c44a2

Browse files
committed
Auto merge of #2590 - GuillaumeGomez:private-fields, r=Amanieu
Make some freebsd private struct fields public and upgrade crate version to 0.2.112 Otherwise we can't use the structs at all...
2 parents a11e45e + 62e20fd commit 55c44a2

File tree

4 files changed

+30
-23
lines changed

4 files changed

+30
-23
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libc"
3-
version = "0.2.111"
3+
version = "0.2.112"
44
authors = ["The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

libc-test/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libc-test"
3-
version = "0.2.111"
3+
version = "0.2.112"
44
authors = ["The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
build = "build.rs"
@@ -12,7 +12,7 @@ A test crate for the libc crate.
1212

1313
[dependencies.libc]
1414
path = ".."
15-
version = "0.2.111"
15+
version = "0.2.112"
1616
default-features = false
1717

1818
[build-dependencies]

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,6 +2308,9 @@ fn test_freebsd(target: &str) {
23082308
("kinfo_proc", "ki_tdaddr") => true,
23092309
("kinfo_proc", "ki_pd") => true,
23102310

2311+
// Anonymous type.
2312+
("filestat", "next") => true,
2313+
23112314
// We ignore this field because we needed to use a hack in order to make rust 1.19
23122315
// happy...
23132316
("kinfo_proc", "ki_sparestrings") => true,

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

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -459,33 +459,37 @@ s! {
459459
pub kve_path: [[::c_char; 32]; 32],
460460
}
461461

462+
pub struct __c_anonymous_filestat {
463+
pub stqe_next: *mut filestat,
464+
}
465+
462466
pub struct filestat {
463-
fs_type: ::c_int,
464-
fs_flags: ::c_int,
465-
fs_fflags: ::c_int,
466-
fs_uflags: ::c_int,
467-
fs_fd: ::c_int,
468-
fs_ref_count: ::c_int,
469-
fs_offset: ::off_t,
470-
fs_typedep: *mut ::c_void,
471-
fs_path: *mut ::c_char,
472-
next: *mut filestat,
473-
fs_cap_rights: cap_rights_t,
467+
pub fs_type: ::c_int,
468+
pub fs_flags: ::c_int,
469+
pub fs_fflags: ::c_int,
470+
pub fs_uflags: ::c_int,
471+
pub fs_fd: ::c_int,
472+
pub fs_ref_count: ::c_int,
473+
pub fs_offset: ::off_t,
474+
pub fs_typedep: *mut ::c_void,
475+
pub fs_path: *mut ::c_char,
476+
pub next: __c_anonymous_filestat,
477+
pub fs_cap_rights: cap_rights_t,
474478
}
475479

476480
pub struct filestat_list {
477-
stqh_first: *mut filestat,
478-
stqh_last: *mut *mut filestat,
481+
pub stqh_first: *mut filestat,
482+
pub stqh_last: *mut *mut filestat,
479483
}
480484

481485
pub struct procstat {
482-
tpe: ::c_int,
483-
kd: ::uintptr_t,
484-
vmentries: *mut ::c_void,
485-
files: *mut ::c_void,
486-
argv: *mut ::c_void,
487-
envv: *mut ::c_void,
488-
core: ::uintptr_t,
486+
pub tpe: ::c_int,
487+
pub kd: ::uintptr_t,
488+
pub vmentries: *mut ::c_void,
489+
pub files: *mut ::c_void,
490+
pub argv: *mut ::c_void,
491+
pub envv: *mut ::c_void,
492+
pub core: ::uintptr_t,
489493
}
490494

491495
pub struct itimerspec {

0 commit comments

Comments
 (0)