]> git.feebdaed.xyz Git - 0xmirror/glibc.git/commit
posix: Fix getconf symbolic constants defined in limits.h (BZ# 29147)
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Tue, 9 Dec 2025 13:45:24 +0000 (10:45 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 11 Dec 2025 12:38:21 +0000 (09:38 -0300)
commitf56382e67e73c0b309c7e39c6b122b04b29b6808
tree53f191bc3699989ddefecb8922f2541bf184fb9e
parent910c6bdcf66aec6c455cf455a66a3388ecf6412e
posix: Fix getconf symbolic constants defined in limits.h (BZ# 29147)

POSIX-1.2018 defines that getconf utility shall print symbolic constant
listed under the heading Maximum value and Minimum Values [1], however
current behaviour is to print the values using pathconf or sysconf,
which represents the specific implementation values instead of the
system agnostics ones.

Another issue is for such the symbolic constants, getconf handles them
as a path_var which requires an additional pathname (which does not
make sense for constants values).

The patch fixes it adding a new internal type, LIMITS_H, which only
prints the constant symbolic without requiring an additional path.
Only the values define in glibc provided limits.h plust the GNU
extensions are handled.

Checked on x86_64-linux-gnu.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html)

Tested-by: Yury Khrustalev <yury.khrustalev@arm.com>
Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
posix/Makefile
posix/getconf.c
posix/tst-getconf-limits.py [new file with mode: 0755]