[PATCH] unistd: use __USE_XOPEN2K24 for existing POSIX.1-2024 interfaces

Collin Funk collin.funk1@gmail.com
Sun Feb 22 22:49:40 GMT 2026


Cristian Rodriguez <yo@cristianrodriguez.net> writes:

>> (getentropy): Also define when __USE_XOPEN2K24 is defined.
>
> But the getentropy function does not comply with POSIX.1-2024.yet.
> it sets errno like the original openBSD interface, POSIX says it has
> to be EINVAL.
> It also introduces GETENTROPY_MAX, which it says has a minimum value of 256..
> In the Linux kernel implementation it is pagesize() reads , not 256..
> in order to provide a constant value glibc could just use 4096 across
> all architectures.
> It also does not behave like the BSDs, which aborts the program on any
> error other than:
> [EINVAL]The value of length is greater than {GETENTROPY_MAX}..

I can leave that one hidden under only __USE_MISC if others agree.

The GETENTROPY_MAX macro should be defined in limits.h. I planned to do
each header separately otherwise review would be difficult.

Collin


More information about the Libc-alpha mailing list