[all-commits] [llvm/llvm-project] 16036f: [libc] Add getgrouplist entrypoint (#226958)
Jeff Bailey via All-commits
all-commits at lists.llvm.org
Mon Sep 28 13:21:54 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 16036fdccdbcc14b5ae6afb54529733bb9741b0f
https://github.com/llvm/llvm-project/commit/16036fdccdbcc14b5ae6afb54529733bb9741b0f
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/grp.yaml
M libc/src/grp/CMakeLists.txt
A libc/src/grp/getgrouplist.cpp
A libc/src/grp/getgrouplist.h
M libc/src/grp/grp_utils.cpp
M libc/src/grp/grp_utils.h
M libc/test/src/grp/CMakeLists.txt
A libc/test/src/grp/getgrouplist_test.cpp
Log Message:
-----------
[libc] Add getgrouplist entrypoint (#226958)
Add the getgrouplist entrypoint from <grp.h> (BSD extension), which
scans the group database to obtain the list of groups to which a user
belongs.
The base group passed by the caller is included unconditionally, and
supplementary groups for the user are gathered with duplicate group IDs
suppressed. A small-buffer-optimised container avoids heap allocations
for users belonging to up to 32 groups, falling back to dynamic
allocation when more groups are present. Note that this fallback does
not use AllocChecker because it relies on realloc to grow the buffer.
The lookup uses a scoped database stream to avoid disturbing concurrent
iteration.
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