Go to file
kre 3f1f0cc730 Fix the code that deals with very long sleeps (> 248 days) which
go beyond the maximum that the callout mechanism can handle.
[See the comments in tvtohz() in subr_sleep.c for the details.]

When that happens the timeout is clamped to MAX_INT (ticks), and the
code in nanosleep1() looped (or tried to) repeating the sleep (aka
kpause()) until the requested end time for the sleep was reached.

Unfortunately, the code assumed that kpause() would return 0 when
it returned after the timeout expired.   But it doesn't, it returns
EWOULDBLOCK instead (why is incomprehensible to me, but I assume
there is a reason.)   [That comes from sleepq_block() which returns
EWOULDBLOCK when callout_halt() indicates that the callout had fired,
which is exactly what has happened when the time has elapsed.]

There was already code to deal with that EWOULDBLOCK and return 0
instead of an error in that case - but it was placed after the
error code was tested against 0 for the purposes of the loop.

Simply move the EWOULDBLOCK->0 mapping earlier, so the code which
is expecting "error == 0" to mean "nothing went wrong" actually
gets to see that happen, and the loop can actually loop.

(Someday the loop should probably be rewritten as a loop, instead of
as a bunch of code followed by a "goto again"!)
2019-03-10 14:45:53 +00:00
bin The previous commit was obviously made by a broken mindless automoton 2019-03-01 06:15:01 +00:00
common rbtree: Add a define to mark function arguments as unused for non debug 2019-03-08 09:14:54 +00:00
compat don't build kernel grovelling tools as n64 on sgimips - we don't actually have 2018-09-20 02:51:21 +00:00
crypto Replace our buggy recallocarray implementation one with the portable one 2019-03-08 20:34:24 +00:00
dist/pf - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
distrib libvdpau pkg-config file is called vdpau.pc. 2019-03-10 12:44:58 +00:00
doc Sync TODO.sanitizers with reality 2019-03-10 12:59:03 +00:00
etc - build and install libvdpau and x86 and evbarm. 2019-03-10 11:18:02 +00:00
external only do vdpau headers on vdpau systems. 2019-03-10 13:52:11 +00:00
extsrc
games Shorter than a season - The Soul Of A New Machine 2019-02-24 12:34:00 +00:00
include add missing externs. 2019-03-10 03:54:08 +00:00
lib Fix previous... We need to deal with a conditional branch. 2019-03-09 02:50:07 +00:00
libexec on m68010 set BOZO_WRSZ to 16k and BOZO_WRSZ to 64k. 2019-03-08 03:12:28 +00:00
regress Don't test call gates, they are not supported anymore. 2017-08-30 15:46:19 +00:00
rescue fix duplicated chunk from merge 2019-01-27 04:33:29 +00:00
sbin make ext2fs rev1 the default. this enables LARGEFILES support. 2019-03-06 05:11:13 +00:00
share Add support for multiple threads in kcov(4) 2019-03-10 12:54:39 +00:00
sys Fix the code that deals with very long sleeps (> 248 days) which 2019-03-10 14:45:53 +00:00
tests Fix bug in kcov_multiple_threads in t_kcov 2019-03-10 13:24:50 +00:00
tools add most of the AMDGPU target makefiles and stuff that don't 2019-03-10 12:14:05 +00:00
usr.bin no -g 2019-03-09 16:18:37 +00:00
usr.sbin remove 30-urw-aliases.conf and add 45-generic.conf and 60-generic.conf. 2019-03-09 23:46:34 +00:00
build.sh add aliases for evbarm without saying 'earm': 2019-02-08 02:05:32 +00:00
BUILDING regen 2018-07-29 20:53:41 +00:00
Makefile .WAIT for tools to complete. 2018-11-11 07:43:35 +00:00
Makefile.inc Re-add files that were accidentally deleted in my previous commit. 2018-05-02 07:34:44 +00:00
README.md Tidy up a bit. 2018-10-23 15:44:42 +00:00
UPDATING add a quick note about gcc 7 likely causing update build failures. 2019-02-08 09:57:01 +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