From 4b0433d29523f522bdec176588270d164c038096 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 12 Dec 2021 23:10:27 +0100 Subject: [PATCH] Make some private struct fields public --- libc-test/build.rs | 3 ++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 44 ++++++++++++++----------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index fcd6ad613771a..351a21e29b5c3 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2302,6 +2302,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, diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 864d5b493392a..5a6b917950959 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -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 {