Skip to content

[libc][cpio] Add cpio.h header. #123798

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

Merged
merged 6 commits into from
Jan 24, 2025
Merged

[libc][cpio] Add cpio.h header. #123798

merged 6 commits into from
Jan 24, 2025

Conversation

siya100
Copy link
Contributor

@siya100 siya100 commented Jan 21, 2025

[libc][docs] add cpio to documentation and include related functi…
These changes ensure that the cpio header is documented properly
with respect to the issue (#122006 ).

Changes:

  1. cpio.yaml: Created a new YAML file for cpio with functions
    and related macros.
  2. CMakeLists.txt: Added cpio to the documentation
    directories.
  3. index.rst: Included cpio in the documentation index.

Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the libc label Jan 21, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 21, 2025

@llvm/pr-subscribers-libc

Author: None (siya100)

Changes

[libc][docs] add cpio to documentation and include related functi…
These changes ensure that the cpio header is documented properly
with respect to the issue (#122006 ).

Changes:

  1. cpio.yaml: Created a new YAML file for cpio with functions
    and related macros.
  2. CMakeLists.txt: Added cpio to the documentation
    directories.
  3. index.rst: Included cpio in the documentation index.

Full diff: https://github.com/llvm/llvm-project/pull/123798.diff

3 Files Affected:

  • (modified) libc/docs/CMakeLists.txt (+1)
  • (modified) libc/docs/headers/index.rst (+1)
  • (added) libc/utils/docgen/cpio.yaml (+31)
diff --git a/libc/docs/CMakeLists.txt b/libc/docs/CMakeLists.txt
index f88d7c27f9f6b3..b2ead3ffc5e657 100644
--- a/libc/docs/CMakeLists.txt
+++ b/libc/docs/CMakeLists.txt
@@ -37,6 +37,7 @@ if (SPHINX_FOUND)
       aio
       arpa/inet
       assert
+      cpio
       ctype
       errno
       fenv
diff --git a/libc/docs/headers/index.rst b/libc/docs/headers/index.rst
index 858b2142defa92..e457df558b1398 100644
--- a/libc/docs/headers/index.rst
+++ b/libc/docs/headers/index.rst
@@ -8,6 +8,7 @@ Implementation Status
    arpa/inet
    assert
    complex
+   cpio
    ctype
    errno
    fenv
diff --git a/libc/utils/docgen/cpio.yaml b/libc/utils/docgen/cpio.yaml
new file mode 100644
index 00000000000000..d2371c9efb9d3f
--- /dev/null
+++ b/libc/utils/docgen/cpio.yaml
@@ -0,0 +1,31 @@
+functions:
+  cpio_open:
+    in-latest-posix: ''
+  cpio_create:
+    in-latest-posix: ''
+  cpio_read:
+    in-latest-posix: ''
+  cpio_write:
+    in-latest-posix: ''
+  cpio_close:
+    in-latest-posix: ''
+macros:
+  CPIO_ACCESS:
+    in-latest-posix: ''
+  CPIO_CREATE:
+    in-latest-posix: ''
+  CPIO_EXTRACT:
+    in-latest-posix: ''
+  CPIO_LINK:
+    in-latest-posix: ''
+  CPIO_RENAME:
+    in-latest-posix: ''
+  CPIO_SYMLINK:
+    in-latest-posix: ''
+  CPIO_DELETE:
+    in-latest-posix: ''
+  CPIO_TRUNCATE:
+    in-latest-posix: ''
+  CPIO_UNLINK:
+    in-latest-posix: ''
+

@lntue lntue requested a review from nickdesaulniers January 22, 2025 16:28
@lntue lntue changed the title added cpio header [libc][cpio] Add cpio.h header. Jan 22, 2025
Copy link
Member

@nickdesaulniers nickdesaulniers left a comment

Choose a reason for hiding this comment

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

Thanks for the patch. Something funny is going on here with this header.
https://pubs.opengroup.org/onlinepubs/9799919799/ doesn't show any of these functions or macros you listed...were they removed from posix?

Comment on lines 13 to 30
CPIO_ACCESS:
in-latest-posix: ''
CPIO_CREATE:
in-latest-posix: ''
CPIO_EXTRACT:
in-latest-posix: ''
CPIO_LINK:
in-latest-posix: ''
CPIO_RENAME:
in-latest-posix: ''
CPIO_SYMLINK:
in-latest-posix: ''
CPIO_DELETE:
in-latest-posix: ''
CPIO_TRUNCATE:
in-latest-posix: ''
CPIO_UNLINK:
in-latest-posix: ''
Copy link
Member

Choose a reason for hiding this comment

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

Strange; these aren't in the latest posix either. Where did you find this list of funcitons?

@siya100
Copy link
Contributor Author

siya100 commented Jan 24, 2025

have made the changes @nickdesaulniers can you review

Copy link
Member

@nickdesaulniers nickdesaulniers left a comment

Choose a reason for hiding this comment

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

LGTM; thanks for the patch! Do you need us to merge this for you?

@siya100
Copy link
Contributor Author

siya100 commented Jan 24, 2025

LGTM; thanks for the patch! Do you need us to merge this for you?

@siya100
Copy link
Contributor Author

siya100 commented Jan 24, 2025

yess

@nickdesaulniers nickdesaulniers merged commit d398c0c into llvm:main Jan 24, 2025
6 checks passed
Copy link

@siya100 Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

in-latest-posix: ''
C_ISSOCK:
in-latest-posix: ''
MAGIC:
Copy link
Member

Choose a reason for hiding this comment

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

Should that be here?

I came to this review because that user posted a comment that looked suspiciously like spam and saw they had contributed to LLVM in this PR. From one of their comments, it looks like this user may be contributing AI-generated stuff. There's nothing wrong with that in theory, but I'd advise doing careful review of these diffs. If you think I'm being needlessly careful here, feel free to let me know.

Copy link
Member

Choose a reason for hiding this comment

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

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/cpio.h.html

The <cpio.h> header shall define the following symbolic constant as a string:
MAGIC "070707"

Copy link
Member

Choose a reason for hiding this comment

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

Ah, thanks, I missed that!

@siya100
Copy link
Contributor Author

siya100 commented Feb 21, 2025

heyy can you please tell mw where i am lacking or how i can modify the yaml file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants