Skip to content

apple: add posix_spawn_file_actions_add(f)chdir(_np) - #5558

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
xjtu-ctgg:apple-spawn-chdir
Oct 1, 2026
Merged

tgross35 merged 1 commit into
rust-lang:mainfrom
xjtu-ctgg:apple-spawn-chdir

Conversation

@xjtu-ctgg

@xjtu-ctgg xjtu-ctgg commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add posix_spawn_file_actions_addchdir_np and posix_spawn_file_actions_addfchdir_np, available since macOS 10.15, and the POSIX.1-2024 posix_spawn_file_actions_addchdir and posix_spawn_file_actions_addfchdir, available since macOS 26.0.

They are macOS only. The header marks them unavailable on the other Apple platforms, where XNU only has them as SPI.

The XNU source still says macos(16.0) for the POSIX names, while the SDK header says macos(26.0), which is the version they shipped in.

This is the Apple part of #3958.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard doc comment (none added)
  • Tested locally (cargo test -p libc-test --target aarch64-apple-darwin with the macOS 26.2 SDK, plus cargo check for aarch64-apple-ios and x86_64-apple-darwin)

@rustbot label +stable-nominated

Copilot AI lite review requested due to automatic review settings September 24, 2026 08:23
@rustbot rustbot added O-bsd O-macos O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@xjtu-ctgg

Copy link
Copy Markdown
Contributor Author

The NetBSD failure is unrelated to this PR: the package mirror failed, and the retry in ci/bsd-prepare.sh never kicked in because sleep 3s isn't valid on NetBSD. #5559 fixes that. Everything else passes (59 jobs), so this should be green once the NetBSD job can retry properly.

@tgross35 tgross35 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@madsmtm we probably shouldn't add anything marked __SPI_AVAILABLE, right?

View changes since this review

Comment thread src/unix/bsd/apple/mod.rs Outdated
fd: c_int,
newfd: c_int,
) -> c_int;
// Available starting with macOS 10.15.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't have these comments elsewhere, could you delete them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deleted, thanks. I'll hold off on anything else until you and @madsmtm have settled the __SPI_AVAILABLE question.

@madsmtm

madsmtm commented Oct 1, 2026

Copy link
Copy Markdown
Member

@madsmtm we probably shouldn't add anything marked __SPI_AVAILABLE, right?

Yes, we shouldn't, those are for Apple's embedded OSes IIUC.

@madsmtm madsmtm left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To be clear, I think adding the APIs in this PR is fine.

View changes since this review

@tgross35 tgross35 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for taking a look!

View changes since this review

@tgross35
tgross35 added this pull request to the merge queue Oct 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 1, 2026
@tgross35
tgross35 added this pull request to the merge queue Oct 1, 2026
Merged via the queue into rust-lang:main with commit 9e01c7f Oct 1, 2026
61 checks passed
@tgross35 tgross35 mentioned this pull request Oct 1, 2026
renovate-bot pushed a commit to renovate-bot/rust-lang-_-libc that referenced this pull request Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-bsd O-macos O-unix S-waiting-on-maintainer stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants