Skip to content

Commit

Permalink
Auto merge of #2590 - GuillaumeGomez:private-fields, r=Amanieu
Browse files Browse the repository at this point in the history
Make some freebsd private struct fields public and upgrade crate version to 0.2.112

Otherwise we can't use the structs at all...
  • Loading branch information
bors committed Dec 13, 2021
2 parents a11e45e + 62e20fd commit 55c44a2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libc"
version = "0.2.111"
version = "0.2.112"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions libc-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libc-test"
version = "0.2.111"
version = "0.2.112"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
Expand All @@ -12,7 +12,7 @@ A test crate for the libc crate.

[dependencies.libc]
path = ".."
version = "0.2.111"
version = "0.2.112"
default-features = false

[build-dependencies]
Expand Down
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2308,6 +2308,9 @@ fn test_freebsd(target: &str) {
("kinfo_proc", "ki_tdaddr") => true,
("kinfo_proc", "ki_pd") => true,

// Anonymous type.
("filestat", "next") => true,

// We ignore this field because we needed to use a hack in order to make rust 1.19
// happy...
("kinfo_proc", "ki_sparestrings") => true,
Expand Down
44 changes: 24 additions & 20 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,33 +459,37 @@ s! {
pub kve_path: [[::c_char; 32]; 32],
}

pub struct __c_anonymous_filestat {
pub stqe_next: *mut filestat,
}

pub struct filestat {
fs_type: ::c_int,
fs_flags: ::c_int,
fs_fflags: ::c_int,
fs_uflags: ::c_int,
fs_fd: ::c_int,
fs_ref_count: ::c_int,
fs_offset: ::off_t,
fs_typedep: *mut ::c_void,
fs_path: *mut ::c_char,
next: *mut filestat,
fs_cap_rights: cap_rights_t,
pub fs_type: ::c_int,
pub fs_flags: ::c_int,
pub fs_fflags: ::c_int,
pub fs_uflags: ::c_int,
pub fs_fd: ::c_int,
pub fs_ref_count: ::c_int,
pub fs_offset: ::off_t,
pub fs_typedep: *mut ::c_void,
pub fs_path: *mut ::c_char,
pub next: __c_anonymous_filestat,
pub fs_cap_rights: cap_rights_t,
}

pub struct filestat_list {
stqh_first: *mut filestat,
stqh_last: *mut *mut filestat,
pub stqh_first: *mut filestat,
pub stqh_last: *mut *mut filestat,
}

pub struct procstat {
tpe: ::c_int,
kd: ::uintptr_t,
vmentries: *mut ::c_void,
files: *mut ::c_void,
argv: *mut ::c_void,
envv: *mut ::c_void,
core: ::uintptr_t,
pub tpe: ::c_int,
pub kd: ::uintptr_t,
pub vmentries: *mut ::c_void,
pub files: *mut ::c_void,
pub argv: *mut ::c_void,
pub envv: *mut ::c_void,
pub core: ::uintptr_t,
}

pub struct itimerspec {
Expand Down

0 comments on commit 55c44a2

Please sign in to comment.