Skip to content

Correct the definition of pthread_t on Darwin#4989

Open
chengr4 wants to merge 1 commit into
rust-lang:mainfrom
chengr4:finish-highjeans-work
Open

Correct the definition of pthread_t on Darwin#4989
chengr4 wants to merge 1 commit into
rust-lang:mainfrom
chengr4:finish-highjeans-work

Conversation

@chengr4

@chengr4 chengr4 commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes #2903. This PR picks up the work started by @highjeans in #4336 (close #4336) which had stalled. I just followed up the comments from @tgross35 in the PR and tried to finish it.

Thanks for leaving a great start point to study this crate.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@chengr4

chengr4 commented Feb 21, 2026

Copy link
Copy Markdown
Contributor Author

Hi @tgross35,

Could you help me understand why pub use new::*; and pub use crate::unix::*; in src/lib.rs conflict with each other, while other modules do not?

@highjeans

highjeans commented Feb 21, 2026

Copy link
Copy Markdown

Hi @chengr4, thanks for finishing this! I really wanted to do this myself but I got caught up in a bunch of work for my university so I ended up forgetting about this.

One thing to note, since now opaque_pthread_t is now just an empty enum, we dont need any of the new constants defined in apple/b32/mod.rs and apple/b64/mod.rs.

Also make sure to run the style checker in /ci/style.py before this is ready!

@chengr4 chengr4 force-pushed the finish-highjeans-work branch from 9fade92 to d79f324 Compare February 21, 2026 23:19
@rustbot rustbot added A-CI Area: CI-related items ctest Issues relating to the ctest crate labels Feb 21, 2026
@chengr4 chengr4 force-pushed the finish-highjeans-work branch from d79f324 to 37afe49 Compare February 21, 2026 23:26
@chengr4

chengr4 commented Feb 21, 2026

Copy link
Copy Markdown
Contributor Author

@highjeans Thank for answering; I totally forgot 🫠. Again, Thanks for leaving the PR for me to study this crate.

@tgross35

Actually, I failed cargo test --test ctest at my local.

bad `ELAST` value at byte 0: rust: 106 (0x6a) != c 107 (0x6b)
    rust bytes: 6a 00 00 00
    c bytes:    6b 00 00 00
bad `HOST_VM_INFO64_COUNT` value at byte 0: rust: 38 (0x26) != c 40 (0x28)
    rust bytes: 26 00 00 00
    c bytes:    28 00 00 00
bad `vm_statistics64_data_t` size: rust: 152 != c 160
bad `vm_statistics64` size: rust: 152 != c 160
size of `vm_statistics64_data_t` is 160 in C and 152 in Rust

size of `struct vm_statistics64` is 160 in C and 152 in Rust

Can you please guide me how to evaluate and fix this bug?

@chengr4 chengr4 marked this pull request as ready for review February 21, 2026 23:41
@JohnTitor JohnTitor changed the title Finish highjeans work Correct the definition of pthread_t on Darwin May 14, 2026
@JohnTitor

Copy link
Copy Markdown
Member

@chengr4 because your system has different version(s) than CI, I think. It's fine as long as CI passes (unless it's unspported).
Could you squash commits into one? Otherwise LGTM on my end.

@chengr4

chengr4 commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

ok will do it after 6/12

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

rustbot commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • The following commits have merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

    You can start a rebase with the following commands:

    $ # rebase
    $ git pull --rebase https://github.com/rust-lang/libc.git main
    $ git push --force-with-lease
    

@chengr4 chengr4 force-pushed the finish-highjeans-work branch from 8924db4 to 6b7c9b6 Compare June 16, 2026 03:48
@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@chengr4 chengr4 force-pushed the finish-highjeans-work branch from 6b7c9b6 to 3f7fcfb Compare June 16, 2026 04:09
@chengr4

chengr4 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@JohnTitor if commit mesage is not clear enough, help me fix it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: CI-related items ctest Issues relating to the ctest crate S-waiting-on-author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect pthread_t definition on Darwin (should be a raw pointer, not an uintptr_t)

4 participants