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
bm.h
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
dirent.h Make fdopendir visible according to POSIX.1 spec. 2021-12-30 16:20:19 +00:00
disktab.h
dlfcn.h
endian.h
err.h err.h: dead once is dead enough 2022-01-06 00:16:47 +00:00
errno.h
fenv.h
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
inttypes.h
iso646.h
kvm.h
langinfo.h
libgen.h
limits.h libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
link.h
link_aout.h
link_elf.h Remove duplicate word in a comment 2020-09-22 01:52:16 +00:00
locale.h
login_cap.h
lwp.h
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
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
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
paths.h
pwd.h
quota.h
randomid.h
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
sched.h
search.h
semaphore.h
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
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
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
time.h
ttyent.h
tzfile.h Sync with 2019b (field name change) 2019-07-03 15:49:21 +00:00
ucontext.h
ulimit.h
unistd.h libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
util.h
utime.h
utmp.h
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