NetBSD/lib/libc/gen
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
..
Lint___setjmp14.c
Lint___sigsetjmp14.c
Lint__setjmp.c
Lint_alloca.c
Lint_bswap16.c
Lint_bswap32.c
Lint_bswap64.c
Lint_fabs.c
Lint_flt_rounds.c
Lint_fpgetmask.c
Lint_fpgetround.c
Lint_fpgetsticky.c
Lint_fpsetmask.c
Lint_fpsetround.c
Lint_fpsetsticky.c
Lint_frexp.c
Lint_ldexp.c
Lint_modf.c
Lint_resumecontext.c
Lint_swapcontext.c
Makefile.inc libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
_errno.c
_lwp_makecontext.3
alarm.3
alarm.c
alphasort.c scandir/alphasort take "const struct dirent **" not "const void *" in 2016-12-16 04:45:04 +00:00
arc4random.3 Fix mdoclint warnings. 2016-07-15 21:19:19 +00:00
arc4random.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
assert.c Don't make assert use stdio; saves >100K on an empty static binary. 2017-05-15 16:09:09 +00:00
asysctl.c cast for size_t 2017-01-10 17:45:58 +00:00
basename.3
basename.c basename_r and dirname_r are non-standard and different from what we define 2014-07-16 10:52:26 +00:00
bsd_signal.3 Remove trailing whitespace. Fix Xr. Fix Dd argument. 2016-06-06 08:27:22 +00:00
bswap.3
cgetcap.3 Fix typo: s/cexpandtc/csetexpandtc 2017-10-24 18:42:06 +00:00
clock.3
clock.c
closedir.c
closefrom.3
closefrom.c Revert to commits as they broke few rump tests 2018-01-17 01:24:29 +00:00
confstr.3
confstr.c
cpuset.3
ctermid.3
ctermid.c
ctype.3 Use \- for minus. 2019-01-15 07:01:01 +00:00
ctype_.c Extend ctype classification table to 16bit. Based on patch by 2013-04-13 10:21:20 +00:00
daemon.3
daemon.c
dehumanize_number.c make sure errno is always set when we return -1 (Anon Ymous) 2020-08-18 19:18:06 +00:00
devname.3 Fix typo. 2017-09-10 10:12:43 +00:00
devname.c appease string + int warning. 2019-02-18 20:27:20 +00:00
directory.3 Document that rewinddir(3) might either reopen or just lseek the dir. 2021-02-17 23:51:04 +00:00
dirent_private.h
dirname.3
dirname.c HACK: if calling dirname() with the results of a previous dirname() 2018-09-27 00:45:34 +00:00
disklabel.c
endutent.3 Fix xref, add missing word. 2021-02-26 06:39:14 +00:00
endutxent.3 revert previous; utmpxname is already documented in getlastlogx.3. Should 2020-07-05 01:09:48 +00:00
err.3 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
err.c
errc.c Fix conditionals. 2014-06-06 11:38:41 +00:00
errlist.awk
errno.c
errx.c
exec.3 exec(3): execlpe() first argument should be named "file" 2022-01-04 20:01:52 +00:00
execl.c
execle.c
execlp.c add execvpe, execlpe (reviewed by phone) 2014-09-26 19:28:03 +00:00
exect.c Revert to commits as they broke few rump tests 2018-01-17 01:24:29 +00:00
execv.c
execvp.c add execvpe, execlpe (reviewed by phone) 2014-09-26 19:28:03 +00:00
extattr.c Remove redundant null check before free. it is safe to free(NULL) 2017-03-09 11:39:41 +00:00
extattr_copy_file.3 s/unaccessible/inaccessible/ 2021-12-10 19:30:05 +00:00
extattr_namespace_to_string.3
fabs_ieee754.c Add fabsl alias if necessary. 2013-11-29 22:15:26 +00:00
fixunsdfsi_ieee754.c Include softfloat-for-gcc.h for __ARM_EABI__ to get aeabi aliases. 2013-04-30 01:44:07 +00:00
fixunsgen64_ieee754.c
fixunsgen_ieee754.c fix various typos in comments and log messages. 2022-04-16 18:15:20 +00:00
fixunssfsi_ieee754.c Include softfloat-for-gcc.h for __ARM_EABI__ to get aeabi aliases. 2013-04-30 01:44:07 +00:00
fixunstfdi_ieee754.c
fixunstfsi_ieee754.c
floatunditf_ieee754.c Provide a simple floatunditf implementation, at least mips64 needs one. 2014-01-30 15:06:18 +00:00
floatunsidf_ieee754.c Add __floatunsi{sd}f for IEEE754. 2013-08-23 16:01:35 +00:00
floatunsisf_ieee754.c Add __floatunsi{sd}f for IEEE754. 2013-08-23 16:01:35 +00:00
fmtcheck.3 Teach fmtcheck(3) that a pointer and a long are not the same. 2014-06-14 08:18:24 +00:00
fmtcheck.c Revert change made by rev 1.11; now, fmtcheck(3) does not complain about 2017-12-13 06:43:45 +00:00
fmtmsg.3
fmtmsg.c make more descriptors that we open as close-on-exec 2014-09-18 13:58:20 +00:00
fnmatch.3
fnmatch.c Fix fnmatch issues according to POSIX. 2014-10-12 22:32:33 +00:00
fpclassify.3
fpclassifyd_ieee754.c
fpclassifyf_ieee754.c
fpclassifyl_ieee754.c Fix very stupid typo 2013-11-23 11:40:56 +00:00
fpgetmask.3
fstab.c
ftok.3 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
ftok.c Avoid undefined behavior in ftok(3) 2018-07-26 00:05:28 +00:00
fts.3 Strings are NUL-terminated, not NULL-terminated. 2013-06-30 19:19:12 +00:00
fts.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
ftw.3
ftw.c
getbsize.3
getbsize.c
getcap.c Make shared -DSMALL libc buildable without breaking libhack 2017-06-18 03:56:39 +00:00
getcwd.3
getcwd.c
getdevmajor.3 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
getdevmajor.c
getdiskbyname.3
getdomainname.3 PR/49642: change processor to host 2015-02-06 17:35:46 +00:00
getdomainname.c
getentropy.3 libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
getentropy.c libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
getfsent.3
getgrent.3 Fix typos, as reported by Eitan Adler. Update dates. 2018-02-07 11:16:05 +00:00
getgrent.c
getgrouplist.3 Remove trailing comma after last Nm entry in the NAME section 2017-10-24 18:54:03 +00:00
getgrouplist.c
getgroupmembership.c
gethostname.3 PR/49641 - Henning Petersen -- wordo 2015-09-03 04:05:38 +00:00
gethostname.c
getlastlogx.3
getloadavg.3
getloadavg.c
getlogin.c getlogin_r: use strcpy(). We check namelen before copying the result. 2019-10-05 19:19:51 +00:00
getmntinfo.3 Don't refer getfsstat() using .Xr as we don't have man page for it anymore. 2016-06-12 09:42:41 +00:00
getmntinfo.c
getnetgrent.3
getnetgrent.c PR 51002 David Binderman: fix wrong printing code not enabled by default. 2016-05-31 03:43:10 +00:00
getpagesize.3
getpagesize.c
getpass.3 Add getpass_r and getpassfd to the NAME section as well. 2017-10-24 18:50:46 +00:00
getpass.c PR/50695: coypu: ctrl-c in su password input breaks shell (bash, csh) 2016-01-31 23:41:38 +00:00
getprogname.3
getprogname.c Instead of compiling files with -fcommon, create an include file and declare 2021-04-20 21:42:31 +00:00
getpwent.3 Fix typos, as reported by Eitan Adler. Update dates. 2018-02-07 11:16:05 +00:00
getpwent.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
getttyent.3 don't lie about function signatures. 2014-02-07 20:20:56 +00:00
getttyent.c Rearrange to make lint deal with it (to unbreak the build). 2013-06-30 10:07:43 +00:00
getusershell.3
getusershell.c
glob.3 Add GLOB_TILDE_CHECK (from GNU) 2019-05-29 01:21:33 +00:00
glob.c Add GLOB_TILDE_CHECK (from GNU) 2019-05-29 01:21:33 +00:00
gr_private.h
humanize_number.3 Fix typo. 2019-03-12 22:21:53 +00:00
humanize_number.c PR lib/54053 2019-03-11 15:10:51 +00:00
infinity_ieee754.c
infinityf_ieee754.c
infinityl_dbl_ieee754.c
infinityl_ieee754.c
initdir.c Make sure dd_size is init'd, even when nothing has been read (so it 2021-07-11 16:30:41 +00:00
initgroups.3
initgroups.c
isalnum.3
isalpha.3
isascii.3 isascii.3: fix typo 2021-02-21 16:33:22 +00:00
isascii.c
isatty.c
isblank.3
iscntrl.3
isctype.c Remove most LC_CTYPE specific parts of locale.cache. 2013-08-19 22:43:28 +00:00
isdigit.3
isfinite.3
isfinited_ieee754.c
isfinitef_ieee754.c
isfinitel_ieee754.c
isgraph.3
isgreater.3
isinf.3 Move VAX notes to CAVEATS, clarify that it just returns zero 2017-09-27 09:04:30 +00:00
isinfd_ieee754.c fix various typos in compatibility, mainly in comments. 2021-08-09 20:49:08 +00:00
isinff_ieee754.c
isinfl_ieee754.c Make ext_fraclm and ext_frachm parts of the long double mantissa optional 2013-11-21 14:14:13 +00:00
islower.3
isnan.3 move VAX notes to CAVEATS, clarify. 2017-09-27 18:55:50 +00:00
isnand_ieee754.c fix various typos in compatibility, mainly in comments. 2021-08-09 20:49:08 +00:00
isnanf_ieee754.c
isnanl_ieee754.c Make ext_fraclm and ext_frachm parts of the long double mantissa optional 2013-11-21 14:14:13 +00:00
isnormal.3
isprint.3
ispunct.3
isspace.3 Improve wording. 2012-10-03 19:28:44 +00:00
isupper.3
isxdigit.3
lockf.3
lockf.c
makecontext.3
nftw.c
nice.3
nice.c
nlist.3 Add comma in enumeration. 2020-03-30 22:14:48 +00:00
nlist.c make more descriptors that we open as close-on-exec 2014-09-18 13:58:20 +00:00
nlist_aout.c
nlist_coff.c
nlist_ecoff.c
nlist_elf32.c lint comment 2016-02-26 17:12:53 +00:00
nlist_elf64.c
nlist_private.h Be less of a minefield for new architectures. They're not going to be a.out. 2020-03-30 20:34:11 +00:00
opendir.c - Use O_DIRECTORY to open the file, so that we don't need to stat() after 2014-11-26 16:48:43 +00:00
pause.3
pause.c
popen.3 popen.3: revert s/null-/nul-/ change, this is subject to debate 2022-03-27 00:32:15 +00:00
popen.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
posix_spawn.3 Sort SEE ALSO. 2021-11-15 14:06:50 +00:00
posix_spawn_file_actions_addchdir.3 More cleanups and typo corrections. 2021-11-15 16:00:25 +00:00
posix_spawn_file_actions_addopen.3 Sort errors. Bump date for previous. 2014-02-02 16:59:13 +00:00
posix_spawn_file_actions_init.3 Sort errors. Bump date for previous. 2014-02-02 16:59:13 +00:00
posix_spawn_fileactions.c Commit the userland portion of the posix_spawn_chdir project by Piyush Sachdeva 2021-11-07 14:34:30 +00:00
posix_spawn_sched.c Remove paranthesis from return operands. 2014-02-02 14:54:39 +00:00
posix_spawnattr_getflags.3 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
posix_spawnattr_getpgroup.3 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
posix_spawnattr_getschedparam.3 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
posix_spawnattr_getschedpolicy.3 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
posix_spawnattr_getsigdefault.3 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
posix_spawnattr_getsigmask.3 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
posix_spawnattr_init.3 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
posix_spawnp.c Do as the manual says, and use _PATH_DEFPATH if PATH is not present in 2020-05-11 14:54:34 +00:00
psignal.3
psignal.c
pthread_atfork.3 Use Nx. 2014-07-19 14:58:50 +00:00
pthread_atfork.c fix various typos in comments, documentation and messages. 2022-05-31 08:43:13 +00:00
pw_private.h
pw_scan.c
pwcache.3 Add missing functions from the SYNOPSIS to the NAME section 2017-10-24 19:04:58 +00:00
pwcache.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
pwcache.h
raise.3
raise.c
randomid.3 Use commas at the right places in the NAME section 2017-10-24 19:07:12 +00:00
randomid.c s/wich/which in comments. 2022-05-15 20:37:50 +00:00
readdir.c
realpath.3 Improve grammar. Pointed out by Timo Buhrmester on netbsd-docs list. 2017-03-06 09:24:09 +00:00
rewinddir.c
scandir.3 Fix typo. 2016-12-17 10:25:49 +00:00
scandir.c reallocarr returns errno. preserve it. 2022-03-12 17:31:39 +00:00
seekdir.c wrap a long line 2013-03-06 11:27:46 +00:00
setdomainname.c
sethostname.c
setjmp.3 Clarify what happens when you longjmp(..., 0). 2021-05-24 23:59:59 +00:00
setjmperr.c
setmode.3 reallocarr returns errno. preserve it. 2022-03-12 17:31:39 +00:00
setmode.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
setproctitle.3
setproctitle.c Instead of compiling files with -fcommon, create an include file and declare 2021-04-20 21:42:31 +00:00
setprogname.c
shquote.3 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
shquote.c
shquotev.c
sighold.3
sighold.c
sigignore.3
sigignore.c
siginterrupt.3
siginterrupt.c
siglist.c Fix three of these strings (ones that are rarely seen) 2016-07-09 21:15:00 +00:00
signal.3 typo 2021-08-07 03:17:23 +00:00
signal.c Add bsd_signal as required by POSIX (from GSoC 2016, Charles Cui) 2016-06-03 23:57:37 +00:00
signalname.3 When not compiling -DSMALL permit use of names RTMIN[+n] and RTMAX[-n] 2020-08-20 22:56:56 +00:00
signalname.c Add the new signalname/signalnext/signalnumber interface to libc. 2017-05-09 11:14:16 +00:00
signalnext.c Add the new signalname/signalnext/signalnumber interface to libc. 2017-05-09 11:14:16 +00:00
signalnumber.c When not compiling -DSMALL permit use of names RTMIN[+n] and RTMAX[-n] 2020-08-20 22:56:56 +00:00
signame.c
signbit.3
signbitd_ieee754.c
signbitf_ieee754.c
signbitl_ieee754.c Unify signbitl implementations. 2019-04-26 09:03:46 +00:00
sigrelse.3
sigrelse.c
sigset.3
sigset.c
sigsetops.3
sigsetops.c
sleep.3
sleep.c
stringlist.3 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
stringlist.c reallocarr returns errno. preserve it. 2022-03-12 17:31:39 +00:00
sysconf.3 Fix _SC_TIMER_MAX listing, bump date 2016-08-03 12:40:42 +00:00
sysconf.c PR 54619: Remove semaphore limit introduce as part of GSoC 2016 with 2019-12-15 20:25:25 +00:00
sysctl.3 Fix markup, and remove two superfluous Pp. 2019-09-15 07:01:13 +00:00
sysctl.c libc/gen: fix hack for previously unsupported lint initializers 2021-03-30 15:31:51 +00:00
sysctlbyname.c
sysctlgetmibinfo.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
sysctlnametomib.c
syslog.3 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
syslog.c undo SSP damage from -Wsystem-headers 2017-01-12 18:16:52 +00:00
syslog_private.h lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
syslog_ss.c fix *syslog_ss* 2017-01-15 16:41:39 +00:00
telldir.c remove unnecessary casts 2013-03-06 11:27:28 +00:00
time.3
time.c
times.3
times.c
timespec_get.3 timespec_get(3) was developed by myself 2020-06-02 19:30:29 +00:00
timespec_get.c return 0 on unsupported bases. 2016-10-04 12:48:15 +00:00
timezone.3
toascii.3
toascii.c
tolower.3
tolower_.c Use more consistent naming for tolower/toupper translation table for the 2013-04-13 10:16:27 +00:00
toupper.3
toupper_.c Use more consistent naming for tolower/toupper translation table for the 2013-04-13 10:16:27 +00:00
ttyname.3
ttyname.c
ttyslot.c
ualarm.3
ualarm.c
ulimit.3
ulimit.c
uname.3 Document the relationship between uname(3) and sysctl(7) variables. 2014-06-14 14:32:43 +00:00
uname.c If sysctl kern.version returns a string that's too long 2014-06-14 13:09:37 +00:00
unvis.3 Clarify that strunvisx() and strnunvisx() take the same flags as unvis(). 2019-05-08 15:37:41 +00:00
unvis.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
usleep.3
usleep.c
utime.3 Do not use hard-coded values with ENAMETOOLONG, use symbolic constants 2014-10-19 16:47:51 +00:00
utime.c
utimens.c Remove _INCOMPLETE_XOPEN_C063, no longer needed 2019-09-16 01:25:16 +00:00
utmp.c
utmpx.c use VIS_NOLOCALE 2015-05-23 11:48:13 +00:00
valloc.3
valloc.c
verr.c Add the {v,}{err,warn}c flavors, from FreeBSD. 2014-01-16 17:21:38 +00:00
verrc.c Fix conditionals. 2014-06-06 11:38:41 +00:00
verrx.c
vis.3 Remove superfluous Pp. 2017-08-05 20:22:29 +00:00
vis.c PR/56260: Alex Richardson: Out-of-bounds stack read in lib/libc/gen/vis.c 2021-06-18 10:57:14 +00:00
vwarn.c Add the {v,}{err,warn}c flavors, from FreeBSD. 2014-01-16 17:21:38 +00:00
vwarnc.c Fix conditionals. 2014-06-06 11:38:41 +00:00
vwarnx.c
wait.c
wait3.c
waitid.c revert part of previous; not needed. 2016-04-06 04:09:10 +00:00
waitpid.c
warn.c
warnc.c Fix conditionals. 2014-06-06 11:38:41 +00:00
warnx.c
wordexp.3 s/occured/occurred/ in comments, log messages and man pages. 2021-12-10 20:36:02 +00:00
wordexp.c
xsyslog.c Add sysloglike attr. 2020-03-02 15:30:25 +00:00