Page MenuHomeFreeBSD

libc: Fix getentropy POSIX 2024 conformance issues
ClosedPublic

Authored by emaste on Nov 20 2024, 7:42 PM.
Tags
None
Referenced Files
F108171148: D47689.diff
Wed, Jan 22, 4:50 AM
Unknown Object (File)
Sat, Jan 18, 12:27 AM
Unknown Object (File)
Fri, Jan 17, 6:12 PM
Unknown Object (File)
Dec 15 2024, 7:42 PM
Unknown Object (File)
Nov 29 2024, 7:10 PM
Unknown Object (File)
Nov 24 2024, 4:02 PM
Unknown Object (File)
Nov 23 2024, 12:36 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.Fri, Jan 17, 6:11 PM