Go to file
riastradh bdad8b2721 New system call getrandom() compatible with Linux and others.
Three ways to call:

getrandom(p, n, 0)              Blocks at boot until full entropy.
                                Returns up to n bytes at p; guarantees
                                up to 256 bytes even if interrupted
                                after blocking.  getrandom(0,0,0)
                                serves as an entropy barrier: return
                                only after system has full entropy.

getrandom(p, n, GRND_INSECURE)  Never blocks.  Guarantees up to 256
                                bytes even if interrupted.  Equivalent
                                to /dev/urandom.  Safe only after
                                successful getrandom(...,0),
                                getrandom(...,GRND_RANDOM), or read
                                from /dev/random.

getrandom(p, n, GRND_RANDOM)    May block at any time.  Returns up to n
                                bytes at p, but no guarantees about how
                                many -- may return as short as 1 byte.
                                Equivalent to /dev/random.  Legacy.
                                Provided only for source compatibility
                                with Linux.

Can also use flags|GRND_NONBLOCK to fail with EWOULDBLOCK/EAGAIN
without producing any output instead of blocking.

- The combination GRND_INSECURE|GRND_NONBLOCK is the same as
  GRND_INSECURE, since GRND_INSECURE never blocks anyway.

- The combinations GRND_INSECURE|GRND_RANDOM and
  GRND_INSECURE|GRND_RANDOM|GRND_NONBLOCK are nonsensical and fail
  with EINVAL.

As proposed on tech-userlevel, tech-crypto, tech-security, and
tech-kern, and subsequently adopted by core (minus the getentropy part
of the proposal, because other operating systems and participants in
the discussion couldn't come to an agreement about getentropy and
blocking semantics):

https://mail-index.netbsd.org/tech-userlevel/2020/05/02/msg012333.html
2020-08-14 00:53:15 +00:00
bin Use the right size for several calloc calls. 2020-08-09 00:53:38 +00:00
common Part I of ad@'s performance improvements for aarch64 2020-08-12 12:59:57 +00:00
compat
crypto move $VERSION from Makefile.inc into the single Makefile that uses it. 2020-07-23 07:53:35 +00:00
dist/pf Externalize variables owned logically by pf_ruleset.c 2020-04-22 23:40:40 +00:00
distrib New system call getrandom() compatible with Linux and others. 2020-08-14 00:53:15 +00:00
doc sync 2020-08-11 15:35:17 +00:00
etc Fix minor typo, it's npf(7), not npf(4) 2020-08-09 23:43:58 +00:00
external regen mknative files for GCC 7.5. 2020-08-13 07:19:59 +00:00
extsrc
games robots: Use arc4random_uniform for better uniform distribution 2020-07-26 15:38:22 +00:00
include nameser_compat.h: correct preprocessor error syntax 2020-06-28 02:16:19 +00:00
lib New system call getrandom() compatible with Linux and others. 2020-08-14 00:53:15 +00:00
libexec Add -DNO_BLOCKLIST_SUPPORT also to small/Makefile. 2020-07-13 10:35:17 +00:00
regress citrus SUBDIR is gone 2020-06-27 11:06:43 +00:00
rescue smb is no more. 2020-04-04 17:57:16 +00:00
sbin Find the if a device points to an active filesystem by looking at the mount 2020-08-08 11:44:55 +00:00
share update GCC 7 version to nb4 20200810, and fix the unknown GCC version 2020-08-11 09:51:57 +00:00
sys New system call getrandom() compatible with Linux and others. 2020-08-14 00:53:15 +00:00
tests New system call getrandom() compatible with Linux and others. 2020-08-14 00:53:15 +00:00
tools set MODULE to ${EXTERNAL_GCC_SUBDIR} so this actually works.. 2020-08-13 10:57:53 +00:00
usr.bin make(1): fix type mismatch in compare_expression 2020-08-13 20:13:46 +00:00
usr.sbin Silence -Wstringop-truncation for ``name'' in disp_selected_part(). 2020-08-10 06:54:45 +00:00
build.sh make(1): remove references to the removed lst.lib 2020-07-26 09:17:24 +00:00
BUILDING
Makefile automatically remove old debug files for modules. 2020-05-15 16:34:44 +00:00
Makefile.inc
README.md Use first-level heading for "NetBSD" title in README.md 2020-01-10 12:33:28 +00:00
UPDATING 20200811: 2020-08-12 06:48:50 +00:00

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