Go to file
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
bin fix various typos in comments, documentation and messages. 2022-05-31 08:43:13 +00:00
common One more typo; this is called _atomic_swap_64, not _8. 2022-05-29 08:11:15 +00:00
compat fix various typos in comments and log messages. 2022-05-29 10:47:39 +00:00
crypto sshd_config: Disable HPN as discussed on tech-userlevel. 2022-05-09 15:06:29 +00:00
dist/pf Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889. 2021-07-24 21:31:31 +00:00
distrib libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
doc Fix dates for previous; it is still 20220530 for UTC ;) 2022-05-30 15:22:44 +00:00
etc Introduce libc_aligned.so for evbppc-powerpc32, which provides 2022-05-30 15:06:54 +00:00
external mk: Add a MKPPP flag to exclude pppd(8) and related utilities from 2022-05-29 08:09:59 +00:00
extsrc
games gomoku: clean up variable names, add empty lines 2022-05-29 22:03:29 +00:00
include libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
lib libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
libexec fix various typos in comments, documentation and messages. 2022-05-31 08:43:13 +00:00
regress fix various typos, mainly in comments, but also log messages, docs, game text. 2022-04-08 10:17:52 +00:00
rescue remove threads; size constraints and behavioral change 2022-05-16 14:55:56 +00:00
sbin fix various typos in comments, documentation and messages. 2022-05-31 08:43:13 +00:00
share fix various typos in comments, documentation and messages. 2022-05-31 08:43:13 +00:00
sys s/longeset/longest/ and s/collsion/collision/ in comments. 2022-05-31 12:59:00 +00:00
tests libc: Reintroduce getentropy. 2022-05-31 13:42:58 +00:00
tools s/hidding/hiding/ 2022-05-28 22:00:55 +00:00
usr.bin fix various typos in comments, documentation and messages. 2022-05-31 08:43:13 +00:00
usr.sbin mk: Add MKTIMED and MKMOUSED flags for compiling NetBSD without timed 2022-05-29 15:23:20 +00:00
BUILDING s/knowlege/knowledge/ 2022-05-28 21:54:56 +00:00
Makefile Makefile: fix location of postinstall program for MAKEVERBOSE > 2 2022-03-19 14:35:13 +00:00
Makefile.inc
README.md README: use https for man.NetBSD.org 2021-09-05 12:45:44 +00:00
UPDATING s/dissallow/disallow/ 2021-12-07 21:45:31 +00:00
build.sh Don't try to install netbsd-CONFIG.debug files build with kernel= 2021-12-31 15:43:35 +00:00

README.md

NetBSD

NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system. It is available for a wide range of platforms, from large-scale servers and powerful desktop systems to handheld and embedded devices.

Building

You can cross-build NetBSD from most UNIX-like operating systems. To build for amd64 (x86_64), in the src directory:

./build.sh -U -u -j4 -m amd64 -O ~/obj release

Additional build information available in the BUILDING file.

Binaries

Testing

On a running NetBSD system:

cd /usr/tests; atf-run | atf-report

Troubleshooting

Latest sources

To fetch the main CVS repository:

cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P src

To work in the Git mirror, which is updated every few hours from CVS:

git clone https://github.com/NetBSD/src.git