Skip to content

Commit

Permalink
[illumos] enable guess_os_stack_limit (#88)
Browse files Browse the repository at this point in the history
Uses the same logic as FreeBSD and DragonflyBSD.

This does require a version of libc with
rust-lang/libc#3788 included. Hopefully that goes out
soon. For now I'm putting up this PR as a thing to point to.

I've verified locally on an illumos machine that stacker is able to:

* find the right stack size, and
* create new stack segments.
  • Loading branch information
sunshowers committed Aug 21, 2024
1 parent 91cf50a commit 8e925da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test = false

[dependencies]
cfg-if = "1.0.0"
libc = "0.2.45"
libc = "0.2.156"
psm = { path = "psm", version = "0.1.7" }

[target.'cfg(windows)'.dependencies.windows-sys]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ cfg_if! {
assert_eq!(libc::pthread_attr_destroy(attr.as_mut_ptr()), 0);
Some(stackaddr as usize)
}
} else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] {
} else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "illumos"))] {
unsafe fn guess_os_stack_limit() -> Option<usize> {
let mut attr = std::mem::MaybeUninit::<libc::pthread_attr_t>::uninit();
assert_eq!(libc::pthread_attr_init(attr.as_mut_ptr()), 0);
Expand Down

0 comments on commit 8e925da

Please sign in to comment.