Skip to content

[libc] Revise the definition of {get, set}rlimit. #124701

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 1 commit into from
Jan 28, 2025
Merged

Conversation

c8ef
Copy link
Contributor

@c8ef c8ef commented Jan 28, 2025

Closes #124633.

Some parameter types in the definition of {get, set}rlimit currently do not match the standard. This patch resolves the issue.
ref: https://man7.org/linux/man-pages/man2/getrlimit.2.html

@c8ef c8ef marked this pull request as ready for review January 28, 2025 05:56
@llvmbot llvmbot added the libc label Jan 28, 2025
@c8ef c8ef requested a review from nickdesaulniers January 28, 2025 05:56
@llvmbot
Copy link
Member

llvmbot commented Jan 28, 2025

@llvm/pr-subscribers-libc

Author: None (c8ef)

Changes

Closes #124633.

Some parameter types in the definition of {get, set}rlimit currently do not match the standard. This patch resolves the issue.
ref: https://man7.org/linux/man-pages/man2/getrlimit.2.html


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

1 Files Affected:

  • (modified) libc/include/sys/resource.yaml (+3-1)
diff --git a/libc/include/sys/resource.yaml b/libc/include/sys/resource.yaml
index 3652d6d490a49b..e7645a3b4f0b3e 100644
--- a/libc/include/sys/resource.yaml
+++ b/libc/include/sys/resource.yaml
@@ -12,10 +12,12 @@ functions:
       - POSIX
     return_type: int
     arguments:
+      - type: int
       - type: struct rlimit *
   - name: setrlimit
     standards:
       - POSIX
     return_type: int
     arguments:
-      - type: const struct rlimit
+      - type: int
+      - type: const struct rlimit *

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! Need us to merge this for you?

@c8ef c8ef merged commit 5a8fe9e into llvm:main Jan 28, 2025
18 checks passed
@c8ef c8ef deleted the resource branch January 28, 2025 16:24
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.

[libc][sys/resource] wrong function signature for setrlimit in generated sys/resource.h
3 participants