Skip to content
Closed
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
8 changes: 8 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,12 @@ extern {
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int;
pub fn clock_gettime(clk_id: ::c_ulong, tp: *mut ::timespec) -> ::c_int;

pub fn pthread_attr_get_np(tid: ::pthread_t,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these functions have the same signature on both dragonflybsd and freebsd? if they do, then please put them in the src/unix/bsd/freebsdlike/mod.rs file instead. thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. https://www.freebsd.org/cgi/man.cgi?query=pthread_attr_get_np. Also, guard page code for FreeBSD seems to be missing in Rust. Did you run "gmake check" when building rust? One test that overflows the stack on purpose should also fail for FreeBSD (it fails on DragonFly). I will add those functions then to the common code base for both DragonFly and FreeBSD

attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t) -> ::c_int;
pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
stackaddr: *mut *mut ::c_void,
stacksize: *mut ::size_t) -> ::c_int;
}