trampoline exclusively, thus relegating "sigcontext"-style handlers (which
have not been documented for many years now) to the dustbin of the compat
library.
When these functions where added to stdio.h 1.72 on 2008-08-04, the
conditional included _NETBSD_SOURCE.
The additional condition was removed in stdio.h 1.99 from 2020-03-20,
but the comment was not updated.
In stdio.h 1.1 from 1993-03-21, the struct had a member named _ub for
the ungetc buffer. That member was repurposed in stdio.h 1.42 from
2001-12-07 in order to support wide characters.
Remove the reference to the 'WARNING above' since there is no such
warning and even when this comment was added in stdio.h 1.20 from
1998-02-02, there was none.
The 'fairly grotesque' from 1994-04-03 referred to the conditional
definition of the type fpos_t, using two different integer types that
both happened to be 64-bit.
When stdio was changed on 2012-01-22 to keep track of the mbstate, the
conditional type definition was removed and the comment no longer made
sense.
- define u_{char,short,int,long} if we don't have _NETBSD_SOURCE defined
so that this compiles (and resolv.h since it includes this). This is
the simplest solution. Others:
- always define them (bad, pollutes namespace)
- create <sys/utypes.h> (bad, overkill)
- change them to unsigned {char, short, int long} (bad, too disruptive)
Changes:
- Add a new field r_ldbase in the r_debug struct.
- Set r_version to 1.
This harmonizes the support with OpenBSD and Linux.
FreeBSD uses version 0 (or no version).
Solaris uses version 2 that is not implemented elsewhere and relies on
SVR4 specific design and interfaces.
Update the code comments as r_debug and link_map is used by other software
than GDB, namely: sanitizers, rump, LLDB.
Posted to tech-userlevel@ a week ago and reviewed by riastradh@.
GETENTROPY(3) Library Functions Manual GETENTROPY(3)
NAME
getentropy - fill a buffer with high quality random data
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
int
getentropy(void *buf, size_t buflen);
DESCRIPTION
The getentropy() function fills a buffer with high quality random data,
suitable for seeding cryptographically secure psuedorandom number
generators.
getentropy() is only intended for seeding random number generators and is
not intended for use by regular code which simply needs secure random
data. For this purpose, please use arc4random(3).
The maximum value for buflen is 256 bytes.
IMPLEMENTATION NOTES
getentropy() reads from the sysctl(7) variable kern.arandom.
RETURN VALUES
The getentropy() function returns 0 on success, and -1 if an error
occurred.
ERRORS
getentropy() will succeed unless:
[EFAULT] The buf argument points to an invalid memory address.
[EIO] Too many bytes were requested.
SEE ALSO
arc4random(3), rnd(4)
STANDARDS
The getentropy() function is non-standard.
HISTORY
The getentropy() function first appeared in OpenBSD 5.6, then in
FreeBSD 12.0, and NetBSD 10.
C++ without real static_assert() can be incompatible with the C fallback
as presented in openjdk.
A pre-C11 compiler can be picky on the implementation.
max_align_t does not depend on any pre-C99 or !C++ language feature.
This structure is in use in 3rd party essential C++ code as an extension
for older language revisions and in gnu99 code in the NetBSD distribution
(RTLD's build rules define -std=gnu11 just for exposing this struct).
Exposing max_align_t from the central NetBSD header avoid duplicate
definition in 3rd party code that could differ and produce ABI mismatched
binaries between -std= revisions.
This problem does not exist on OSs like Linux as they get this namespace
visibility defined inside LLVM or GNU toolchain headers. NetBSD ships with
its own stddef.h, rather than relying on a toolchain and its internal
extensions.
the main effect of this is to make GCC and other libiberty using
tools use /tmp instead of /var/tmp for compiler temp files,
which can be a bottleneck on larger systems.
a survey of other platforms shows only OSX also uses /var/tmp,
everyone else has switched to /tmp long ago.
cons: some smaller systems may have a smaller /tmp than /var/tmp,
and this may cause builds to fail with out of space earlier.
point the build to /var/tmp using TMPDIR in this case.
one can argue that setting TMPDIR would work around this, but we
want to have the effect for all users without having special setup.
Remove const from the 2nd argument.
const char ** and char ** are incompatible types and it was a cost to keep
the technically incompatible form for a more purist variation. NetBSD was
almost the last alive OS to still keep the const argument (known leftovers:
Minix and Illumos).
Keep the const form for the internal purposes inside citrus and rump.
Address the build breakage fallout in the same change.
There are no ABI changes.
Change accepted by core@.