Skip to content

Add support for renameat_with on Apple platforms#1340

Merged
sunfishcode merged 1 commit intobytecodealliance:mainfrom
Stebalien:steb/renameat-apple
Feb 22, 2025
Merged

Add support for renameat_with on Apple platforms#1340
sunfishcode merged 1 commit intobytecodealliance:mainfrom
Stebalien:steb/renameat-apple

Conversation

@Stebalien
Copy link
Copy Markdown
Contributor

Apple platforms (both iOS and macOS) added a renameat2 equivalent in 10.12 (and the iOS equivalent). This patch uses that syscall to implement renameat2, and subsequently renameat_with.

Unlike Linux, the RenameFlags::WHITEOUT flag isn't supported. At the moment, any programs trying to use that flag will fail to compile on Apple operating systems.

@Stebalien
Copy link
Copy Markdown
Contributor Author

Testing wise... I do not have a mac. I'm adding support here so I can use it in tempfile without having to directly depend on libc. I'm really hoping that CI-based debugging will be sufficient here because, if not, I'll have to give up.

@Stebalien Stebalien force-pushed the steb/renameat-apple branch 4 times, most recently from 8c4d77a to 1acff62 Compare February 21, 2025 17:59
Apple platforms (both iOS and macOS) added a `renameat2` equivalent in
10.12 (and the iOS equivalent). This patch uses that syscall to
implement `renameat2`, and subsequently `renameat_with`.

Unlike Linux, the `RenameFlags::WHITEOUT` flag isn't supported. At the
moment, any programs trying to use that flag will fail to compile on
Apple operating systems.
@Stebalien Stebalien marked this pull request as ready for review February 21, 2025 18:18
@sunfishcode
Copy link
Copy Markdown
Member

Looks like the CI is happy with it. Thanks for the PR!

@sunfishcode sunfishcode merged commit bf0a982 into bytecodealliance:main Feb 22, 2025
@Stebalien Stebalien deleted the steb/renameat-apple branch February 22, 2025 21:49
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.

2 participants