Fix stack overflow detection on FreeBSD#32726
Conversation
src/libstd/sys/unix/thread.rs Implement several stack-related functions on FreeBSD src/libstd/sys/unix/stack_overflow.rs Fix a comment
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/libstd/sys/unix/thread.rs
Outdated
| } | ||
| assert_eq!(libc::pthread_attr_destroy(&mut attr), 0); | ||
| ret | ||
| } |
There was a problem hiding this comment.
This looks pretty similar to get_stack_start with Linux/Android/NetBSD below, perhaps the two could share code? If the only difference is the name of the function pthread_getattr_np, then some renaming-on import should suffice I think.
src/libstd/sys/unix/thread.rs
Outdated
| #[cfg(not(target_os = "freebsd"))] | ||
| let e = libc::pthread_getattr_np(libc::pthread_self(), &mut attr); | ||
| if e == 0 { | ||
| //if libc::pthread_getattr_np(libc::pthread_self(), &mut attr) == 0 { |
|
@alexcrichton does it look good to you now? |
Fix stack overflow detection on FreeBSD
No description provided.