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

[libc][c11] add support for stdio.h's rename() #84980

Closed
nickdesaulniers opened this issue Mar 12, 2024 · 7 comments · Fixed by #85068
Closed

[libc][c11] add support for stdio.h's rename() #84980

nickdesaulniers opened this issue Mar 12, 2024 · 7 comments · Fixed by #85068
Assignees
Labels
c11 good first issue https://github.com/llvm/llvm-project/contribute libc

Comments

@nickdesaulniers
Copy link
Member

nickdesaulniers commented Mar 12, 2024

See also 7.23.4.2 The rename function in n3096

libc++ needs this for LIBCXX_ENABLE_FILESYSTEM support.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 12, 2024

@llvm/issue-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

See also `7.23.4.2 The rename function` in n3096

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 12, 2024

@llvm/issue-subscribers-c11

Author: Nick Desaulniers (nickdesaulniers)

See also `7.23.4.2 The rename function` in n3096

@nickdesaulniers nickdesaulniers added the good first issue https://github.com/llvm/llvm-project/contribute label Mar 12, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 12, 2024

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. In the comments of the issue, request for it to be assigned to you.
  2. Fix the issue locally.
  3. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  4. Create a Git commit.
  5. Run git clang-format HEAD~1 to format your changes.
  6. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 12, 2024

@llvm/issue-subscribers-good-first-issue

Author: Nick Desaulniers (nickdesaulniers)

See also `7.23.4.2 The rename function` in n3096

libc++ needs this for LIBCXX_ENABLE_FILESYSTEM support.

@aniplcc
Copy link
Contributor

aniplcc commented Mar 13, 2024

Would the implementation be somewhat as in stdio.h's remove() using syscalls? I'll create a PR.

@AtharvKshirsagar
Copy link

Hi I am Atharv Kshirsagar from IIT Bombay.I would like to request you to grant me access to the issue.Thanks

@nickdesaulniers
Copy link
Member Author

Hi @AtharvKshirsagar , @aniplcc already is working on this (is assigned, and their PR is linked above). Thanks for your interest, but there may be another bug that's a better place to start.

nickdesaulniers pushed a commit that referenced this issue Mar 21, 2024
Adds stdio.h's rename() function as defined in n3096. Fixes  #84980.
nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this issue Mar 21, 2024
nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this issue Mar 21, 2024
SYS_rename may be unavailable on architectures such as aarch64 and riscv.
rename can be implemented in terms of SYS_rename, SYS_renameat, or
SYS_renameat2. I don't have a full picture of the history here, but it seems
that SYS_renameat might also be unavailable on some platforms.

`man 2 rename` mentions that SYS_renameat2 was added in Linux 3.15.  We don't
need to support such ancient kernel versions.

Link: llvm#84980
Link: llvm#85068
nickdesaulniers added a commit that referenced this issue Mar 21, 2024
SYS_rename may be unavailable on architectures such as aarch64 and
riscv.
rename can be implemented in terms of SYS_rename, SYS_renameat, or
SYS_renameat2. I don't have a full picture of the history here, but it
seems
that SYS_renameat might also be unavailable on some platforms.

`man 2 rename` mentions that SYS_renameat2 was added in Linux 3.15. We
don't
need to support such ancient kernel versions prior.

Link: #84980
Link: #85068
chencha3 pushed a commit to chencha3/llvm-project that referenced this issue Mar 23, 2024
Adds stdio.h's rename() function as defined in n3096. Fixes  llvm#84980.
chencha3 pushed a commit to chencha3/llvm-project that referenced this issue Mar 23, 2024
chencha3 pushed a commit to chencha3/llvm-project that referenced this issue Mar 23, 2024
SYS_rename may be unavailable on architectures such as aarch64 and
riscv.
rename can be implemented in terms of SYS_rename, SYS_renameat, or
SYS_renameat2. I don't have a full picture of the history here, but it
seems
that SYS_renameat might also be unavailable on some platforms.

`man 2 rename` mentions that SYS_renameat2 was added in Linux 3.15. We
don't
need to support such ancient kernel versions prior.

Link: llvm#84980
Link: llvm#85068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c11 good first issue https://github.com/llvm/llvm-project/contribute libc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants