[libc-commits] [libc] [libc][docs] Add pwd.h POSIX header documentation (PR #186292)

via libc-commits libc-commits at lists.llvm.org
Thu Mar 12 18:42:00 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (kovan)

<details>
<summary>Changes</summary>

Add YAML metadata for `pwd.h` listing all POSIX-mandated functions
(`endpwent`, `getpwent`, `getpwnam`, `getpwnam_r`, `getpwuid`,
`getpwuid_r`, `setpwent`). This header defines no macros per POSIX.

Add `pwd` to `index.rst` and `CMakeLists.txt` `docgen_list`.

Verified with `python3 docgen.py pwd.h` — generates valid RST with correct POSIX links.

Partial fix for #<!-- -->122006

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


3 Files Affected:

- (modified) libc/docs/CMakeLists.txt (+1) 
- (modified) libc/docs/headers/index.rst (+1) 
- (added) libc/utils/docgen/pwd.yaml (+15) 


``````````diff
diff --git a/libc/docs/CMakeLists.txt b/libc/docs/CMakeLists.txt
index 68fe9fc545781..b0797740c68ce 100644
--- a/libc/docs/CMakeLists.txt
+++ b/libc/docs/CMakeLists.txt
@@ -56,6 +56,7 @@ if (SPHINX_FOUND)
       netinet/in
       # TODO: https://github.com/llvm/llvm-project/issues/123821
       # pthread
+      pwd
       setjmp
       signal
       stdbit
diff --git a/libc/docs/headers/index.rst b/libc/docs/headers/index.rst
index 573c5d185f38a..541d71f6851fb 100644
--- a/libc/docs/headers/index.rst
+++ b/libc/docs/headers/index.rst
@@ -21,6 +21,7 @@ Implementation Status
    math/index.rst
    net/if
    netinet/in
+   pwd
    search
    setjmp
    signal
diff --git a/libc/utils/docgen/pwd.yaml b/libc/utils/docgen/pwd.yaml
new file mode 100644
index 0000000000000..156a663c8c5e8
--- /dev/null
+++ b/libc/utils/docgen/pwd.yaml
@@ -0,0 +1,15 @@
+functions:
+  endpwent:
+    in-latest-posix: ''
+  getpwent:
+    in-latest-posix: ''
+  getpwnam:
+    in-latest-posix: ''
+  getpwnam_r:
+    in-latest-posix: ''
+  getpwuid:
+    in-latest-posix: ''
+  getpwuid_r:
+    in-latest-posix: ''
+  setpwent:
+    in-latest-posix: ''

``````````

</details>


https://github.com/llvm/llvm-project/pull/186292


More information about the libc-commits mailing list