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)
Wed, Aug 26, 7:41 AM
Unknown Object (File)
Sun, Aug 23, 2:29 PM
Unknown Object (File)
Fri, Aug 21, 2:55 PM
Unknown Object (File)
Wed, Aug 19, 7:40 PM
Unknown Object (File)
Tue, Aug 18, 11:17 AM
Unknown Object (File)
Thu, Aug 13, 12:22 AM
Unknown Object (File)
Wed, Aug 12, 11:42 PM
Unknown Object (File)
Wed, Aug 12, 9:19 PM
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