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)
Fri, Mar 7, 2:43 AM
Unknown Object (File)
Sun, Feb 23, 11:18 PM
Unknown Object (File)
Sat, Feb 22, 6:45 PM
Unknown Object (File)
Fri, Feb 21, 8:07 PM
Unknown Object (File)
Thu, Feb 20, 2:18 PM
Unknown Object (File)
Feb 7 2025, 4:24 AM
Unknown Object (File)
Jan 30 2025, 5:13 AM
Unknown Object (File)
Jan 22 2025, 8:14 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