Skip to content

Commit 4b0433d

Browse files
Make some private struct fields public
1 parent 3608e31 commit 4b0433d

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

libc-test/build.rs

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

2305+
// Anonymous type.
2306+
("filestat", "next") => true,
2307+
23052308
// We ignore this field because we needed to use a hack in order to make rust 1.19
23062309
// happy...
23072310
("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)