Page MenuHomeFreeBSD

libc: Fix getentropy POSIX 2024 conformance issues
ClosedPublic

Authored by emaste on Nov 20 2024, 7:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 13, 9:00 AM
Unknown Object (File)
Mon, Apr 13, 8:56 AM
Unknown Object (File)
Sun, Apr 12, 2:52 AM
Unknown Object (File)
Tue, Apr 7, 4:04 PM
Unknown Object (File)
Tue, Apr 7, 3:11 AM
Unknown Object (File)
Fri, Apr 3, 7:55 PM
Unknown Object (File)
Sat, Mar 28, 4:33 AM
Unknown Object (File)
Mar 13 2026, 3:46 AM
Subscribers

Details

Summary
GETENTROPY_MAX should be defined in limits.h.  EINVAL is the return
value for buflen > GETENTROPY_MAX.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste created this revision.

I'm not sure how the build is intended to set __POSIX_VISIBLE for building libc's getentropy.c.

imp added inline comments.
include/limits.h
142

Why doesn't this work today? I've recently bumped __POSIX_VISIBLE to 202405 for the default BSD_VISIBLE sources

I'm not sure how the build is intended to set __POSIX_VISIBLE for building libc's getentropy.c.

By default we build with BSD_SOURCE which makes it all visible.

Oh, on ref15-amd64.freebsd.org I get:

#include <sys/cdefs.h>
#include <stdio.h>

int
main(int argc, char *argv[])
{
        printf("__POSIX_VISIBLE=%d\n", __POSIX_VISIBLE);
}

__POSIX_VISIBLE=200809

Restore POSIX_VISIBLE tests - issue was local cross-threading

This revision is now accepted and ready to land.Jan 17 2025, 6:11 PM