Skip to content

Expose mknodat/mkfifoat on Apple targets - #1625

Merged
sunfishcode merged 2 commits into
bytecodealliance:mainfrom
mattsu2020:mknodat_macos
Nov 10, 2026
Merged

sunfishcode merged 2 commits into
bytecodealliance:mainfrom
mattsu2020:mknodat_macos

Conversation

@mattsu2020

@mattsu2020 mattsu2020 commented May 16, 2026 •

Copy link
Copy Markdown

Summary

  • Expose mknodat and mkfifoat on Apple targets.
  • Weak-link mknodat on Apple and return NOSYS when unavailable on older systems.
  • Document the supported Apple OS versions and behavior on older systems for both public APIs.

Closes #1691

@xtqqczze

This comment was marked as resolved.

@oech3

This comment was marked as outdated.

@xtqqczze

This comment was marked as resolved.

@mattsu2020

This comment was marked as resolved.

@xtqqczze

This comment was marked as resolved.

Comment thread src/backend/libc/fs/syscalls.rs Resolved
@mattsu2020
mattsu2020 requested a review from xtqqczze June 30, 2026 09:27
Comment thread src/backend/libc/fs/syscalls.rs Resolved
@xtqqczze

This comment was marked as outdated.

@oech3

This comment was marked as duplicate.

Comment thread src/backend/libc/fs/syscalls.rs Resolved
@badeend

badeend commented Aug 25, 2026

Copy link
Copy Markdown
Member

@mattsu2020 The fix for the CI failure #1620 has been merged. Could you update this PR?

@mattsu2020

This comment was marked as resolved.

@badeend

badeend commented Aug 28, 2026

Copy link
Copy Markdown
Member

@sunfishcode Could you take a look at this? The code change seems relatively straightforward, and it passes CI.

@oech3

This comment was marked as resolved.

@mattsu2020

This comment was marked as resolved.

@xtqqczze

This comment was marked as resolved.

mattsu2020 added a commit to mattsu2020/rustix that referenced this pull request Sep 19, 2026
macOS 13 and corresponding Apple platforms added mknodat/mkfifoat.
These APIs were previously excluded with cfg(not(apple)).

On Apple, resolve mknodat at runtime with the same weak-linking
pattern used for linkat/unlinkat/renameat. If the symbol is absent
(macOS < 13 and older Apple OS variants), return NOSYS so a binary
built against a newer SDK can still run on older systems. Other
targets keep calling libc mknodat directly. mkfifoat goes through
the same path.

Also import Dev and FileType on Apple so the public wrappers
compile, add XNU man-page references, and shrink the unsafe block
around the syscall.
@mattsu2020

This comment was marked as resolved.

xtqqczze

This comment was marked as resolved.

mattsu2020 added a commit to mattsu2020/rustix that referenced this pull request Sep 19, 2026
Weak-link mknodat on Apple and return NOSYS when unavailable on older
systems. Keep direct libc calls on other targets.

Document availability starting in macOS 13.0, iOS 16.0, tvOS 16.0,
and watchOS 9.0 for both APIs.
@mattsu2020

This comment was marked as resolved.

@xtqqczze

This comment was marked as resolved.

Weak-link mknodat on Apple and return NOSYS when unavailable on older
systems. Keep direct libc calls on other targets.
@mattsu2020

This comment was marked as resolved.

@mattsu2020

This comment was marked as resolved.

@xtqqczze

This comment was marked as resolved.

@mattsu2020

This comment was marked as resolved.

@mattsu2020
mattsu2020 requested a review from xtqqczze September 28, 2026 10:01
xtqqczze

This comment was marked as resolved.

@mattsu2020

This comment was marked as resolved.

@xtqqczze

This comment was marked as resolved.

@xtqqczze

This comment was marked as resolved.

@mattsu2020
mattsu2020 requested a review from xtqqczze October 9, 2026 12:58
@xtqqczze

Copy link
Copy Markdown
Contributor

@sunfishcode Would appreciate it if you could take a look at this one.

Resolve reference-link conflicts in mknodat and mkfifoat documentation, preserving Apple, Linux, and FreeBSD references.
@sunfishcode
sunfishcode merged commit ffa6ee5 into bytecodealliance:main Nov 10, 2026
50 of 51 checks passed
@sunfishcode

Copy link
Copy Markdown
Member

Thanks!

@mattsu2020
mattsu2020 deleted the mknodat_macos branch November 10, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support mknodat/mkfifoat on Apple targets

5 participants