NetBSD/include
riastradh 2b5e567d9c libc: Reintroduce getentropy.
This was introduced two years ago when the getrandom/getentropy API
question was still open, and removed because the discussion was
ongoing.  Now getentropy is more widely adopted and soon to be in
POSIX.  So reintroduce the symbol into libc since we'll be keeping it
anyway.  Discussion of details of the semantics, as interpreted by
NetBSD, is ongoing, but the symbol needs to get in before the
netbsd-10 branch.  The draft POSIX text is
(https://www.opengroup.org/austin/docs/austin_1110.pdf):

    SYNOPSIS
        #include <unistd.h>

        int getentropy(void *buffer, size_t length);

    DESCRIPTION
        The getentropy() function shall write length bytes of data
        starting at the location pointed to by buffer. The output
        shall be unpredictable high quality random data, generated by
        a cryptographically secure pseudo-random number
        generator. The maximum permitted value for the length
        argument is given by the {GETENTROPY_MAX} symbolic constant
        defined in <limits.h>.

    RETURN VALUES
        Upon successful completion, getentropy() shall return 0;
        otherwise, -1 shall be retunred and errno set to indicate the
        error.

    ERRORS
        The getentropy() function shall fail if:

        [EINVAL]        The value of length is greater than
                        {GETENTROPY_MAX}.

        The getentropy() function may fail if:

        [ENOSYS]        The system does not provide the necessary
                        source of entropy.

    RATIONALE
        The getentropy() function is not a cancellation point.

Minor changes from the previous introduction of getentropy into libc:

- Return EINVAL, not EIO, on buflen > 256.
- Define GETENTROPY_MAX in limits.h.

The declaration of getentropy in unistd.h and definition of
GETENTROPY_MAX in limits.h are currently conditional on
_NETBSD_SOURCE.  When the next revision of POSIX is finalized, we can
expose them also under _POSIX_C_SOURCE > 20yymmL as usual -- and this
can be done as a pullup without breaking existing compiled programs.
2022-05-31 13:42:58 +00:00
..
arpa nameser_compat.h: simplify logic to determine byte order 2022-04-21 04:03:54 +00:00
protocols Add external attribute dumping and restoring support from FreeBSD. 2021-06-19 13:56:34 +00:00
rpc fix various typos in comments, mainly origional->original, 2022-05-28 21:14:56 +00:00
rpcsvc s/impliment/implement/ in comment. 2020-04-02 15:30:25 +00:00
ssp make the 2nd argument to __memmove_chk() const 2020-09-05 13:37:59 +00:00
Makefile Move the basic part of XDR to common/include/rpc and common/lib/libc/rpc. 2019-06-04 15:07:55 +00:00
a.out.h
aio.h
ar.h
assert.h Remove the static_assert() fallback for pre-C11 and pre-C++11 2020-04-17 15:22:34 +00:00
atomic.h
bitstring.h more casting fixes 2016-03-17 02:25:32 +00:00
bm.h Needs stddef.h for size_t. 2016-01-22 22:27:01 +00:00
cdbw.h
complex.h
cpio.h
ctype.h Fix visibility of various C99 features, esp. for C++11. 2020-03-20 01:08:42 +00:00
db.h sync with mit/kerberos db 2016-09-24 20:11:43 +00:00
dirent.h Make fdopendir visible according to POSIX.1 spec. 2021-12-30 16:20:19 +00:00
disktab.h
dlfcn.h Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This 2017-07-11 15:21:31 +00:00
endian.h Add endian.h header. Simply includes sys/endian.h 2017-10-16 11:38:25 +00:00
err.h err.h: dead once is dead enough 2022-01-06 00:16:47 +00:00
errno.h
fenv.h fexcept_t + fenv_t should be handled the same way for softfloat 2017-04-09 15:29:07 +00:00
fmtmsg.h
fnmatch.h
fstab.h
fts.h
ftw.h
getopt.h
glob.h Add GLOB_TILDE_CHECK (from GNU) 2019-05-29 01:21:33 +00:00
grp.h
hesiod.h
iconv.h Switch the iconv(3) prototype to the POSIX conformant variation 2019-10-24 18:17:14 +00:00
ieeefp.h
ifaddrs.h Add ifa_addrflags to ifaddrs (forgot to commit this file, thanks Ryo!) 2016-09-21 13:32:27 +00:00
inttypes.h strtoi and strtou additions 2015-01-16 18:35:59 +00:00
iso646.h
kvm.h u_char, u_int, u_long -> unsigned char, unsigned, unsigned long 2016-01-22 21:55:57 +00:00
langinfo.h
libgen.h
limits.h libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
link.h
link_aout.h Apparently a recent round of vandalism by the C++ standards committee 2016-01-23 01:26:14 +00:00
link_elf.h Remove duplicate word in a comment 2020-09-22 01:52:16 +00:00
locale.h Go back to just using normal visibility for the locale symbols. Without 2016-04-29 16:26:48 +00:00
login_cap.h Apparently a recent round of vandalism by the C++ standards committee 2016-01-23 01:26:14 +00:00
lwp.h make _lwp_park return the remaining time to sleep in the "ts" argument 2017-12-08 01:19:29 +00:00
malloc.h remove global pointers, add get/seters. 2019-03-12 15:11:13 +00:00
math.h Correct C99 / C++11 feature testing. Document remaining missing symbols. 2020-02-22 22:47:35 +00:00
md2.h define block length 2016-07-01 16:42:46 +00:00
memory.h
mntopts.h Change the default for ACLs to be posix1e instead of nfsv4 to match FreeBSD. 2021-09-18 03:05:19 +00:00
monetary.h PR lib/54744 (bruno@haible.de) 2019-12-08 02:15:02 +00:00
mpool.h remove mpool_getf 2016-09-24 21:18:09 +00:00
mqueue.h
ndbm.h
netconfig.h
netdb.h fix various typos in compatibility, mainly in comments. 2021-08-09 20:49:08 +00:00
netgroup.h
nl_types.h
nlist.h
nsswitch.h Apparently a recent round of vandalism by the C++ standards committee 2016-01-23 01:26:14 +00:00
paths.h add _PATH_DEVZERO 2017-01-16 19:15:28 +00:00
pwd.h
quota.h Add RCS tag. 2017-04-04 12:25:40 +00:00
randomid.h Needs stdint.h. 2016-01-22 23:15:42 +00:00
ranlib.h
re_comp.h
regex.h - Replace REG_ENOSYS (unused) with REG_ILLSEQ. 2021-02-23 17:14:42 +00:00
regexp.h
res_update.h
resolv.h fix typos in comments, mainly s/extention/extension/ and s/sufficent/sufficient/ 2021-09-03 21:54:58 +00:00
rmt.h Needs sys/types.h for mode_t, off_t, ssize_t, and others. 2016-01-22 23:15:58 +00:00
sched.h
search.h amend the new destroy function to take function pointers. 2014-07-20 20:17:21 +00:00
semaphore.h Define SEM_VALUE_MAX in only one place. 2016-04-24 19:48:29 +00:00
setjmp.h
sgtty.h
signal.h Expose sigaltstack, stack_t and friends to Posix Issue 5 (200809L) References: 2021-11-02 20:12:25 +00:00
spawn.h Commit the userland portion of the posix_spawn_chdir project by Piyush Sachdeva 2021-11-07 14:34:30 +00:00
stab.h
stdalign.h Import <stdalign.h> 2016-10-02 17:19:00 +00:00
stddef.h Remove trailing whitespace 2020-05-13 14:00:58 +00:00
stdio.h stdio.h: remove outdated comment for vscanf 2021-09-11 20:05:33 +00:00
stdlib.h PR/56250: Michael Forney: mkstemp/mkdtemp not declared with 2021-07-03 14:07:13 +00:00
stdnoreturn.h Import <stdnoreturn.h> 2016-10-02 13:09:24 +00:00
string.h fix various typos in compatibility, mainly in comments. 2021-08-09 20:49:08 +00:00
stringlist.h
strings.h
struct.h
sysexits.h
tar.h
tgmath.h Add RCS tag. 2017-04-04 12:25:40 +00:00
time.h Add timespec_get(3) in <time.h> and enable unconditionally struct timespec 2016-10-04 09:41:40 +00:00
ttyent.h
tzfile.h Sync with 2019b (field name change) 2019-07-03 15:49:21 +00:00
ucontext.h fixes for GCC 6: 2018-02-04 01:13:45 +00:00
ulimit.h
unistd.h libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
util.h Implement pidfile_lock, pidfile_read and pidfile_clean. 2016-04-10 19:05:50 +00:00
utime.h
utmp.h Needs sys/cdefs.h for __BEGIN_DECLS. Also add time.h to get time_t, 2016-01-22 23:59:44 +00:00
utmpx.h utmpx.h: fix comment missed in r. 1.10 _NETBSD_SOURCE changes 2021-08-15 00:36:11 +00:00
uuid.h
vis.h s/appropiate/appropriate/ in comments and readme file. 2022-05-20 21:31:24 +00:00
wchar.h Fix visibility of various C99 features, esp. for C++11. 2020-03-20 01:08:42 +00:00
wctype.h
wordexp.h