Skip to content

kinfo_cputime/kinfo_file addition for dragonfly #2562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,7 @@ fn test_dragonflybsd(target: &str) {
"sys/file.h",
"sys/ioctl.h",
"sys/ipc.h",
"sys/kinfo.h",
"sys/ktrace.h",
"sys/malloc.h",
"sys/mman.h",
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,8 @@ in6_pktinfo
initgroups
kevent
killpg
kinfo_cputime
kinfo_file
kqueue
labs
lastlog
Expand Down
27 changes: 27 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,33 @@ s! {
pub shm_ctime: ::time_t,
shm_internal: *mut ::c_void,
}

pub struct kinfo_file {
pub f_size: ::size_t,
pub f_pid: ::pid_t,
pub f_uid: ::uid_t,
pub f_fd: ::c_int,
pub f_file: *mut ::c_void,
pub f_type: ::c_short,
pub f_count: ::c_int,
pub f_msgcount: ::c_int,
pub f_offset: ::off_t,
pub f_data: *mut ::c_void,
pub f_flag: ::c_uint,
}

pub struct kinfo_cputime {
pub cp_user: u64,
pub cp_nice: u64,
pub cp_sys: u64,
pub cp_intr: u64,
pub cp_idel: u64,
cp_unused01: u64,
cp_unused02: u64,
pub cp_sample_pc: u64,
pub cp_sample_sp: u64,
pub cp_msg: [::c_char; 32],
}
}

s_no_extra_traits! {
Expand Down