Bug 282783 - getentropy does not exactly match POSIX-2024
Summary: getentropy does not exactly match POSIX-2024
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL: https://reviews.freebsd.org/D47689
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-15 14:56 UTC by Ed Maste
Modified: 2025-01-17 18:24 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2024-11-15 14:56:20 UTC
At least GETENTROPY_MAX is not defined and the return value for buflen > GETENTROPY_MAX should be EINVAL not EIO.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2024-11-22 18:39:58 UTC
Proposed fix in https://reviews.freebsd.org/D47689
Comment 2 demarioshanan 2024-11-25 03:55:49 UTC
MARKED AS SPAM
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-01-17 18:24:15 UTC
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(-)