[all-commits] [llvm/llvm-project] 844f93: [libc] Add getpwent_r entrypoint (#226966)

Jeff Bailey via All-commits all-commits at lists.llvm.org
Mon Sep 28 12:32:30 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 844f9339a276cf18b7aac38c89f02a0d42e2339b
      https://github.com/llvm/llvm-project/commit/844f9339a276cf18b7aac38c89f02a0d42e2339b
  Author: Jeff Bailey <jbailey at raspberryginger.com>
  Date:   2026-09-28 (Mon, 28 Sep 2026)

  Changed paths:
    M libc/config/linux/aarch64/entrypoints.txt
    M libc/config/linux/arm/entrypoints.txt
    M libc/config/linux/i386/entrypoints.txt
    M libc/config/linux/riscv/entrypoints.txt
    M libc/config/linux/x86_64/entrypoints.txt
    M libc/include/pwd.yaml
    M libc/src/__support/pwd/flat_file_db.h
    M libc/src/pwd/CMakeLists.txt
    A libc/src/pwd/getpwent_r.cpp
    A libc/src/pwd/getpwent_r.h
    M libc/src/pwd/pwd_utils.cpp
    M libc/src/pwd/pwd_utils.h
    M libc/test/src/pwd/CMakeLists.txt
    A libc/test/src/pwd/getpwent_r_test.cpp

  Log Message:
  -----------
  [libc] Add getpwent_r entrypoint (#226966)

Add the reentrant password database iteration entrypoint getpwent_r.

getpwent_r reads the next password database record from the stream into
the caller-supplied struct passwd and buffer, returning 0 on success,
ENOENT at end-of-file, or an error number (such as ERANGE) on failure.
When a record exceeds the caller buffer size, FlatFileDatabase::getnext
rewinds the stream to the beginning of that record so that a subsequent
retry with a larger buffer reads the same entry.

* Add getpwent_r entrypoint and pwd::read_next fixed-buffer overload
* Rewind stream on ERANGE in FlatFileDatabase::getnext(EntryType *,
span<char>)
* Define getpwent_r in include/pwd.yaml and Linux entrypoints.txt
* Add unit tests for getpwent_r

Assisted-by: Automated tooling, human reviewed.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list