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

Florian Weimer fweimer@redhat.com
Mon Feb 23 11:06:57 GMT 2026


* Cristian Rodriguez:

>> (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}..

We're not doing this for close, so why would we do it for getentropy?

As long as known POSIX incompatibilities are documented in the manual, I
think we should continue to declare POSIX interfaces that have a
reasonable level of compatibility even in the strict POSIX modes.

Thanks,
Florian



More information about the Libc-alpha mailing list