Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for renameat2 on linux #1458

Merged
merged 1 commit into from
Jul 8, 2021

Conversation

tomboland
Copy link

Hi, please find my PR for adding the linux-specific renameat2 syscall. It's largely similar to renameat, with an additional flags parameter:

The flags are:

  • RENAME_REPLACE - performs an atomic swap.
  • RENAME_NOREPLACE - returns EEXIST if the target already exists.
  • RENAME_WHITEOUT - specific to overly/union filesystems, and I haven't added a test-case for this one.

PLEASE NOTE: It looks like my formatter has made numerous changes. If you have a preferred formatting config then please let me know, and I can push up changes consistent with the accepted style.

I'm not all that experienced with rust, and this is my first time looking at the nix project, so I'm more than happy to receive guidance on improving my submission.

Cheers!

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

Can you please remove formatting changes from the PR?

@tomboland
Copy link
Author

Can you please remove formatting changes from the PR?

Of course, yes. Done.

@tomboland tomboland requested a review from asomers July 5, 2021 14:47
src/fcntl.rs Outdated Show resolved Hide resolved
src/fcntl.rs Outdated Show resolved Hide resolved
tomboland pushed a commit to tomboland/nix that referenced this pull request Jul 5, 2021
@tomboland tomboland requested a review from asomers July 5, 2021 19:46
@asomers
Copy link
Member

asomers commented Jul 8, 2021

Ok, it looks good. Would you mind squashing your commits, and rebasing to fix the CHANGELOG?

@tomboland tomboland force-pushed the feature/add-renameat2 branch from 5c3f183 to 80b1f28 Compare July 8, 2021 17:25
@tomboland
Copy link
Author

Ok, it looks good. Would you mind squashing your commits, and rebasing to fix the CHANGELOG?

Thank you @asomers . That's done now, and everything looks clean!

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

@tomboland tomboland force-pushed the feature/add-renameat2 branch from c870dde to 1a23312 Compare July 8, 2021 21:09
@bors
Copy link
Contributor

bors bot commented Jul 8, 2021

Canceled.

@tomboland
Copy link
Author

bors r+

Apols. I squashed my commits in to one again and interrupted this.

@asomers
Copy link
Member

asomers commented Jul 8, 2021

bors retry

@bors bors bot merged commit d9d447d into nix-rust:master Jul 8, 2021
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.

3 participants