summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2020-05-06Add getentropy() to libc - a simple wrapper to access the kernel CSPRNG.nia
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.
2020-04-17Remove the static_assert() fallback for pre-C11 and pre-C++11kamil
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.
2020-04-05Fix depenency on common symbols in sbin.joerg
2020-04-02 s/impliment/implement/ in comment.msaitoh
2020-03-31Add getsid(2) to the XOPEN namespace (again)kamil
2020-03-31Expose getsid(2) to POSIX >= 2008kamil
2020-03-20Fix visibility of various C99 features, esp. for C++11.joerg
2020-03-01Revert previouskamil
Requested by joerg who wants to fix (ab)users.
2020-03-01Fix typo in a commentkamil
2020-03-01Expose max_align_t to C99/C++kamil
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.
2020-02-22Correct C99 / C++11 feature testing. Document remaining missing symbols.joerg
2019-12-13move P_tmpdir from "/var/tmp/" to "/tmp/".mrg
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.
2019-12-08PR lib/54744 (bruno@haible.de)kre
Add missing __END_DECLS for C++ compiles. XXX pullup -9 XXX pullup -8 (bug not present in -7).
2019-10-24Switch the iconv(3) prototype to the POSIX conformant variationkamil
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@.
2019-09-15remove comment for incomplete x/open impl (kamil)christos
2019-09-15one fexecve declaration should be enough.christos
2019-09-15Remove the _INCOMPLETE_XOPEN_C063 stuff.christos
2019-09-15Declare fexecvechristos
2019-07-03Sync with 2019b (field name change)christos
2019-06-04Move the basic part of XDR to common/include/rpc and common/lib/libc/rpc.hannken
No functional change intended.
2019-06-04Implement xdrmem_control(), used as xdr_control(xdr, XDR_GET_BYTES_AVAIL ...hannken
and bump libc minor number. Final goal is to remove the unmaintained XDR implementation at external/cddl/osnet/dist/uts/common/rpc.
2019-05-29Add GLOB_TILDE_CHECK (from GNU)christos
2019-05-27As a _NETBSD_SOURCE extension define static_assert for pre-c11/c++99kamil
Proposed on source-changes-d.
2019-05-22Limit static_assert visibility to C11.maya
The existing definition caused issues as GCC only provides _Static_assert when building C11 code. This follows the C standard: static_assert available since C11. Fixes https://rt.perl.org/Public/Bug/Display.html?id=134023
2019-04-24Don't install YP headers when MKYP=noroy
2019-04-04merge tzcode 2019achristos
2019-03-12remove global pointers, add get/seters.christos
2019-03-10catch up with name change.christos
2019-03-10add missing externs.christos
2019-03-09add copyright.christos
2019-03-09PR/54050: Ryo ONODERA: Add the jemalloc-specific api prototypes and extern.christos
2019-01-08Provide global variables with C linkage, otherwise they will createjoerg
conflicts for C++ modules use.
2019-01-05We can make a stronger guarantee than __pure.maya
abs/labs don't read global memory. Make GCC 9 happier.
2018-12-28Limit wcslcat, wcslcpy visibility to _NETBSD_SOURCEmaya
wcswidth, wcwidth to POSIX.1-2001 or _NETBSD_SOURCE Updated patch from kretschm in PR standards/39422
2018-11-18more type protection macro lossage.christos
2018-08-15PR standards/53525: move getsubopt() to stdlib.hmartin
2018-06-24Fix the rest of the functions that have been made visible by xopen5,christos
posix 2017, and c99.
2018-06-24PR/53393: coypu: move rint to the right section.christos
2018-02-20Mark in string.h: memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001kamil
2018-02-06fix typochristos
2018-02-06detect duplicate declaration of pthread_atfork() in pthread.hchristos
2018-02-04fixes for GCC 6:mrg
- -Wstrict-prototypes is not available for C++, so don't try to ignore it for C++. - remove many _DIAGASSERT() checks against not NULL for functions with arguments with nonnull attributes. in two cases, leave code behind that should set defaults to "(null)". - use -Wno-error=frame-address for i386 mcount, as it seems valid to assume the caller will have a frame.fair
2018-01-09Merge autofs support from: Tomohiro Kusumichristos
XXX: Does not work yet
2017-12-08make _lwp_park return the remaining time to sleep in the "ts" argumentchristos
if it is a relative timestamp, as discussed in tech-kern. XXX: pullup-8
2017-10-16Add endian.h header. Simply includes sys/endian.hmaya
<endian.h> has been accepted by the austin group.
2017-10-07remove recallocarraychristos
2017-10-07add recallocarray (used by openssh-7.6)christos
2017-08-16Add missing strfmon_l. Noticed by Bruno Haible. Add test case.joerg
2017-08-16s/not sure why// and make these work :-)christos
2017-07-11Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. Thisjoerg
functions are used for destructors of thread_local objects. If a pending destructor exists, prevent unloading of shared objects. Introduce __dl_cxa_refcount interface for this purpose. When the last reference is gone and the object has been dlclose'd before, the unloading is finalized. Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists on providing __cxa_thread_atexit as direct wrapper without further patching.