Skip to content

thread: implements available_concurrency on haiku - #89306

Merged
bors merged 1 commit into
rust-lang:masterfrom
devnexen:haiku_ncpus
Oct 1, 2021
Merged

thread: implements available_concurrency on haiku#89306
bors merged 1 commit into
rust-lang:masterfrom
devnexen:haiku_ncpus

Conversation

@devnexen

Copy link
Copy Markdown
Contributor

No description provided.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 27, 2021
@nagisa

Copy link
Copy Markdown
Member

Seems reasonable to me.

@bors r+

@bors

bors commented Sep 27, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 5d4048b has been approved by nagisa

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 27, 2021
ehuss added a commit to ehuss/rust that referenced this pull request Sep 30, 2021
thread: implements available_concurrency on haiku
@ehussehuss mentioned this pull request Sep 30, 2021
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 30, 2021
thread: implements available_concurrency on haiku
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 30, 2021
thread: implements available_concurrency on haiku
@ManishearthManishearth mentioned this pull request Oct 1, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 1, 2021
…arth
Rollup of 8 pull requests
Successful merges:
- rust-lang#88782 (Fix ICE when `start` lang item has wrong generics)
- rust-lang#89202 (Resolve infered types when complaining about unexpected call type )
- rust-lang#89248 (Suggest similarly named associated items in trait impls)
- rust-lang#89303 (Add `#[must_not_suspend]` to some types in std)
- rust-lang#89306 (thread: implements available_concurrency on haiku)
- rust-lang#89314 (fix(lint): don't suggest refutable patterns to "fix" irrefutable bind)
- rust-lang#89370 (CTFE: tweak aggregate rvalue handling)
- rust-lang#89392 (bootstrap: Update comment in config.library.toml.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit fccfc98 into rust-lang:masterOct 1, 2021
@rustbotrustbot added this to the 1.57.0 milestone Oct 1, 2021
@nielx

nielx commented Oct 2, 2021

Copy link
Copy Markdown
Contributor

This change does not compile and is incorrect.

  • mem::zeroed() and get_system_info() is unsafe, see compiler error message below.
  • system_info() returns a status_t indicating the error code or B_OK. It does not set errno, thus calling io::Error::last_os_error() will give a previous unrelated error code.

@devnexen are you okay to fix this?

error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> library/std/src/sys/unix/thread.rs:342:48
|
342 | let mut sinfo: libc::system_info = crate::mem::zeroed();
| ^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> library/std/src/sys/unix/thread.rs:343:23
|
343 | let res = libc::get_system_info(&mut sinfo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior

@nagisa

Copy link
Copy Markdown
Member

Oh well. I'm open to having this reverted until a fixed version is submitted, too.

@devnexen

Copy link
Copy Markdown
ContributorAuthor

I pushed a PR #89462

@workingjubileeworkingjubilee added the O-haiku Target: Be extant; from mouldering old leaves; spring arrives again label Jul 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-haikuTarget: Be extant; from mouldering old leaves; spring arrives againS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@devnexen@rust-highfive@nagisa@bors@nielx@joshtriplett@workingjubilee@rustbot