At least GETENTROPY_MAX is not defined and the return value for buflen > GETENTROPY_MAX should be EINVAL not EIO.
Proposed fix in https://reviews.freebsd.org/D47689
MARKED AS SPAM
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=473681a1a506daafdae17900fcb42830e0dcb26e commit 473681a1a506daafdae17900fcb42830e0dcb26e Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-11-16 15:14:21 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2025-01-17 18:23:23 +0000 libc: Fix getentropy POSIX 2024 conformance issues GETENTROPY_MAX should be defined in limits.h. EINVAL is the return value for buflen > GETENTROPY_MAX. PR: 282783 Reviewed by: markj, asomers, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47689 include/limits.h | 4 ++++ lib/libc/gen/getentropy.3 | 14 ++++---------- lib/libc/gen/getentropy.c | 5 +++-- 3 files changed, 11 insertions(+), 12 deletions(-)